完全按照官网写,但是页面没有工具栏,控制台里工具栏盒子里也没有内容
<link href="https://unpkg.com/@wangeditor/editor@latest/dist/css/style.css" rel="stylesheet">
<div id="editor—wrapper">
<div id="toolbar-container">
</div>
<div id="editor-container">
</div>
</div>
<script src="https://unpkg.com/@wangeditor/editor@latest/dist/index.js"></script>
<script>
var E = window.wangEditor; // 全局变量
new Vue({
el: '#note-container',
created() {
this.token = localStorage.getItem('token'); //获取存储的元素
// this.getAxios()
const {
createEditor,
createToolbar
} = window.wangEditor
const editorConfig = {
placeholder: 'Type here...',
onChange(editor) {
const html = editor.getHtml()
console.log('editor content', html)
// 也可以同步到 <textarea>
}
}
const editor = createEditor({
selector: '#editor-container',
html: '
',
config: editorConfig,
mode: 'default', // or 'simple'
})
const toolbarConfig = {}
const toolbar = createToolbar({
editor,
selector: '#toolbar-container',
config: toolbarConfig,
mode: 'default', // or 'simple'
})
},