mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Merge 3057489cc66e17b97a77512c1e3621b96c37a4ba into 6858a9ad67483025f6a9432a926beb9327037be3
This commit is contained in:
commit
b76902fbc3
@ -15,6 +15,7 @@
|
|||||||
"test:ci": "npm run lint && npm run test:unit"
|
"test:ci": "npm run lint && npm run test:unit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@toast-ui/editor": "^2.2.0",
|
||||||
"axios": "0.18.1",
|
"axios": "0.18.1",
|
||||||
"clipboard": "2.0.4",
|
"clipboard": "2.0.4",
|
||||||
"codemirror": "5.45.0",
|
"codemirror": "5.45.0",
|
||||||
@ -34,7 +35,6 @@
|
|||||||
"screenfull": "4.2.0",
|
"screenfull": "4.2.0",
|
||||||
"script-loader": "0.7.2",
|
"script-loader": "0.7.2",
|
||||||
"sortablejs": "1.8.4",
|
"sortablejs": "1.8.4",
|
||||||
"tui-editor": "1.3.3",
|
|
||||||
"vue": "2.6.10",
|
"vue": "2.6.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-router": "3.0.2",
|
"vue-router": "3.0.2",
|
||||||
|
@ -4,11 +4,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// deps for editor
|
// deps for editor
|
||||||
import 'codemirror/lib/codemirror.css' // codemirror
|
import 'codemirror/lib/codemirror.css' // Editor's Dependency Style
|
||||||
import 'tui-editor/dist/tui-editor.css' // editor ui
|
import '@toast-ui/editor/dist/toastui-editor.css' // Editor's Style
|
||||||
import 'tui-editor/dist/tui-editor-contents.css' // editor content
|
|
||||||
|
|
||||||
import Editor from 'tui-editor'
|
import Editor from '@toast-ui/editor'
|
||||||
import defaultOptions from './default-options'
|
import defaultOptions from './default-options'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -62,8 +61,8 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newValue, preValue) {
|
value(newValue, preValue) {
|
||||||
if (newValue !== preValue && newValue !== this.editor.getValue()) {
|
if (newValue !== preValue && newValue !== this.editor.getMarkdown()) {
|
||||||
this.editor.setValue(newValue)
|
this.editor.setMarkdown(newValue)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
language(val) {
|
language(val) {
|
||||||
@ -90,10 +89,10 @@ export default {
|
|||||||
...this.editorOptions
|
...this.editorOptions
|
||||||
})
|
})
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
this.editor.setValue(this.value)
|
this.editor.setMarkdown(this.value)
|
||||||
}
|
}
|
||||||
this.editor.on('change', () => {
|
this.editor.on('change', () => {
|
||||||
this.$emit('input', this.editor.getValue())
|
this.$emit('input', this.editor.getMarkdown())
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
destroyEditor() {
|
destroyEditor() {
|
||||||
@ -102,10 +101,10 @@ export default {
|
|||||||
this.editor.remove()
|
this.editor.remove()
|
||||||
},
|
},
|
||||||
setValue(value) {
|
setValue(value) {
|
||||||
this.editor.setValue(value)
|
this.editor.setMarkdown(value)
|
||||||
},
|
},
|
||||||
getValue() {
|
getValue() {
|
||||||
return this.editor.getValue()
|
return this.editor.getMarkdown()
|
||||||
},
|
},
|
||||||
setHtml(value) {
|
setHtml(value) {
|
||||||
this.editor.setHtml(value)
|
this.editor.setHtml(value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user