vue+ wangEditor富文本編輯器加持
安裝
npm install wangEditor --save
組件中調(diào)用
<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>
創(chuàng)建成功