我使用的是mavonEditor插件,下面是步骤:
1.Install mavon-editor (安装)
$ npm install mavon-editor --save
2.在main.js引入
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
Vue.use(mavonEditor)
3.在需要用的地方直接使用
<div>
<mavon-editor v-model="value" @change="changeData" />
</div>
<el-button type="primary" @click="preserve()">保存</el-button>
效果图:
3.1 下面是可以用的事件列表
以change事件为例,
changeData(val,val2){
console.log(val)
console.log(val2)
}
<