fix: remove simplemde
This commit is contained in:
parent
e2ed7e95fd
commit
dd99b57b6e
File diff suppressed because it is too large
Load Diff
|
|
@ -35,7 +35,6 @@
|
||||||
"qs": "^6.9.4",
|
"qs": "^6.9.4",
|
||||||
"quill": "^1.3.7",
|
"quill": "^1.3.7",
|
||||||
"screenfull": "^5.0.2",
|
"screenfull": "^5.0.2",
|
||||||
"simplemde": "^1.11.2",
|
|
||||||
"sortablejs": "^1.10.1",
|
"sortablejs": "^1.10.1",
|
||||||
"ua-parser-js": "^0.7.20",
|
"ua-parser-js": "^0.7.20",
|
||||||
"vant": "^2.11.1",
|
"vant": "^2.11.1",
|
||||||
|
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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-select', () => import('./d2-icon-select/index.vue'))
|
||||||
Vue.component('d2-icon-svg-select', () => import('./d2-icon-svg-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-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-banner', () => import('./d2-module-index-banner'))
|
||||||
Vue.component('d2-module-index-menu', () => import('./d2-module-index-menu'))
|
Vue.component('d2-module-index-menu', () => import('./d2-module-index-menu'))
|
||||||
Vue.component('d2-quill', () => import('./d2-quill'))
|
Vue.component('d2-quill', () => import('./d2-quill'))
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,7 @@ export default {
|
||||||
icon: 'pencil-square-o',
|
icon: 'pencil-square-o',
|
||||||
children: [
|
children: [
|
||||||
{ path: '/demo/components/editor-ueditor', title: 'UEditor', icon: '' },
|
{ path: '/demo/components/editor-ueditor', title: 'UEditor', icon: '' },
|
||||||
{ path: '/demo/components/editor-quill', title: 'Quill', icon: '' },
|
{ path: '/demo/components/editor-quill', title: 'Quill', icon: '' }
|
||||||
{ path: '/demo/components/editor-simpleMDE', title: 'simpleMDE', icon: '' }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ export default {
|
||||||
{ path: 'countup', name: 'demo-components-countup', component: _import('demo/components/countup'), meta: { ...meta, title: '数字动画' } },
|
{ path: 'countup', name: 'demo-components-countup', component: _import('demo/components/countup'), meta: { ...meta, title: '数字动画' } },
|
||||||
{ path: 'editor-ueditor', name: 'demo-components-editor-ueditor', component: _import('demo/components/editor-ueditor'), meta: { ...meta, title: 'UEditor' } },
|
{ path: 'editor-ueditor', name: 'demo-components-editor-ueditor', component: _import('demo/components/editor-ueditor'), meta: { ...meta, title: 'UEditor' } },
|
||||||
{ path: 'editor-quill', name: 'demo-components-editor-quill', component: _import('demo/components/editor-quill'), meta: { ...meta, title: '富文本编辑器' } },
|
{ path: 'editor-quill', name: 'demo-components-editor-quill', component: _import('demo/components/editor-quill'), meta: { ...meta, title: '富文本编辑器' } },
|
||||||
{ path: 'editor-simpleMDE', name: 'demo-components-editor-simpleMDE', component: _import('demo/components/editor-simpleMDE'), meta: { ...meta, title: 'markdown编辑器' } },
|
|
||||||
{ path: 'highlight', name: 'demo-components-highlight', component: _import('demo/components/highlight'), meta: { ...meta, title: '代码高亮组件' } },
|
{ path: 'highlight', name: 'demo-components-highlight', component: _import('demo/components/highlight'), meta: { ...meta, title: '代码高亮组件' } },
|
||||||
{ path: 'icon/icon', name: 'demo-components-icon-icon', component: _import('demo/components/icon/icon.vue'), meta: { ...meta, title: '图标组件' } },
|
{ path: 'icon/icon', name: 'demo-components-icon-icon', component: _import('demo/components/icon/icon.vue'), meta: { ...meta, title: '图标组件' } },
|
||||||
{ path: 'icon/icon-svg', name: 'demo-components-icon-icon-svg', component: _import('demo/components/icon/icon-svg.vue'), meta: { ...meta, title: 'svg 图标' } },
|
{ path: 'icon/icon-svg', name: 'demo-components-icon-icon-svg', component: _import('demo/components/icon/icon-svg.vue'), meta: { ...meta, title: 'svg 图标' } },
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
<template>
|
|
||||||
<d2-container>
|
|
||||||
<d2-mde
|
|
||||||
v-model="text"
|
|
||||||
class="mde"/>
|
|
||||||
<el-card shadow="never" class="d2-card">
|
|
||||||
<pre>{{text}}</pre>
|
|
||||||
</el-card>
|
|
||||||
</d2-container>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import text from './text'
|
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.mde {
|
|
||||||
margin-bottom: -16px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
export default `# 标题
|
|
||||||
|
|
||||||
- 列表
|
|
||||||
- 列表
|
|
||||||
|
|
||||||
\`\`\`
|
|
||||||
alert('Hello')
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
[D2Admin in github](https://github.com/d2-projects/d2-admin)`
|
|
||||||
Loading…
Reference in New Issue