本文示例使用的
- html
- vue
- ckeditor4
监听代码如下
<textarea class="border" id="contentText"
name="docContentText" rows="5" cols="80"></textarea>
data: {
isChanged: false,//富文本是否被编辑(改动)
},
mounted: function () {
const that = this;
//初始化
that.buildckeditor = CKEDITOR.replace('contentText', {height: '500px', width: '99%'});
//配置监听富文本是否被编辑过
that.buildckeditor.on('change', function () {
that.isChanged = true;
});
},