4 changed files with 106 additions and 33 deletions
@ -1,3 +1,43 @@ |
|||
<template> |
|||
<div>55565</div> |
|||
<div id="editorSection" @change="handleChange"></div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Editor from "tui-editor"; /* ES6 */ |
|||
import "tui-editor/dist/tui-editor.css"; // editor's ui |
|||
import "tui-editor/dist/tui-editor-contents.css"; // editor's content |
|||
import "codemirror/lib/codemirror.css"; // codemirror |
|||
import "highlight.js/styles/github.css"; // code block highlight |
|||
import { init } from "echarts/lib/echarts"; |
|||
|
|||
export default { |
|||
name: "mytuieditor", |
|||
mounted() { |
|||
this.initialize(); |
|||
}, |
|||
beforeDestroy() { |
|||
this.tuieditor = null; |
|||
delete this.tuieditor; |
|||
}, |
|||
methods: { |
|||
initialize() { |
|||
if (this.$el) { |
|||
this.tuieditor = new Editor({ |
|||
el: document.querySelector("#editorSection"), |
|||
initialEditType: "wysiwyg", |
|||
previewStyle: "vertical", |
|||
height: "300px" |
|||
}); |
|||
this.tuieditor.getHtml(); |
|||
} |
|||
}, |
|||
|
|||
handleChange(value){ |
|||
console.log('value: ', value); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
|||
|
Loading…
Reference in new issue