<el-dialog :visible.sync="addVisible" class="addDialog" @opened="createEditor" @close="resetForm('addForm')">
<el-form-item prop="noteContent">
<div ref="editor" v-html="addForm.noteEditor"></div>
<el-input type="textarea" v-model="addForm.noteContent" readonly v-show="false" ></el-input>
</el-form-item>
</el-dialog>
import wangEditor from 'wangeditor'
data () {
return {
editor: null,
addForm: {
noteEditor: '',
noteContent: ''
}
}
}
输入内容为noteContent
//创建富文本编辑器
createEditor(){
//创建编辑器
const editor = new wangEditor(this.$refs.editor)
// 设置编辑区域高度为 500px
editor.config.height =