vue+ wangEditor富文本编辑器加持

2019-11-19  本文已影响0人  萧潇墨

vue+ wangEditor富文本编辑器加持

安装

npm install wangEditor --save

组件中调用

<template>
    <div id="editor" ref="editor" style="text-align:left"></div>
</template>
<script>
    import E from 'wangeditor'
    export default {
        mounted() {
            var editor = new E(this.$refs.editor)
            editor.customConfig.onchange = (html) => {
                this.editorContent = html
            }
            editor.customConfig.zIndex = 1;
            editor.customConfig.uploadImgServer = '/upload';
            editor.create()

        },
    }
</script>

创建成功


image
上一篇下一篇

猜你喜欢

热点阅读