fix: remove simplemde

This commit is contained in:
FairyEver
2022-08-23 21:55:00 +08:00
parent e2ed7e95fd
commit dd99b57b6e
8 changed files with 29141 additions and 6666 deletions

View File

@@ -1,64 +0,0 @@
<template>
<textarea ref="mde"></textarea>
</template>
<script>
import { merge } from 'lodash'
import SimpleMDE from 'simplemde'
import 'simplemde/dist/simplemde.min.css'
export default {
name: 'd2-mde',
props: {
// 值
value: {
type: String,
required: false,
default: ''
},
// 配置参数
config: {
type: Object,
required: false,
default: () => ({})
}
},
data () {
return {
// 编辑器实例
mde: null,
// 编辑器默认参数
// 详见 https://github.com/sparksuite/simplemde-markdown-editor#configuration
defaultConfig: {
autoDownloadFontAwesome: false
}
}
},
mounted () {
// 初始化
this.init()
},
destroyed () {
// 在组件销毁后销毁实例
this.mde = null
},
methods: {
// 初始化
init () {
// 合并参数
const config = merge({}, this.defaultConfig, this.config)
// 初始化
this.mde = new SimpleMDE({
...config,
// 初始值
initialValue: this.value,
// 挂载元素
element: this.$refs.mde
})
this.mde.codemirror.on('change', () => {
this.$emit('input', this.mde.value())
})
}
}
}
</script>

View File

@@ -15,7 +15,6 @@ Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue'))
Vue.component('d2-icon-select', () => import('./d2-icon-select/index.vue'))
Vue.component('d2-icon-svg-select', () => import('./d2-icon-svg-select/index.vue'))
Vue.component('d2-markdown', () => import('./d2-markdown'))
Vue.component('d2-mde', () => import('./d2-mde'))
Vue.component('d2-module-index-banner', () => import('./d2-module-index-banner'))
Vue.component('d2-module-index-menu', () => import('./d2-module-index-menu'))
Vue.component('d2-quill', () => import('./d2-quill'))