提交 7854fc18 authored 作者: 王鹏飞's avatar 王鹏飞

update editor.vue component

上级 bde57cd1
......@@ -20,13 +20,15 @@ export default {
},
watch: {
value(val) {
if (this.ckEditor.getData() !== val) {
if (this.ckEditor && this.ckEditor.getData() !== val) {
this.ckEditor.setData(val)
}
},
disabled(val) {
if (this.ckEditor && this.ckEditor.instanceReady) {
this.ckEditor.setReadOnly(val)
}
}
},
methods: {
createEditor() {
......@@ -97,7 +99,6 @@ export default {
editor.setData(data, {
callback: () => {
editor.setReadOnly(this.disabled)
this.bindEvent()
const newData = editor.getData()
......
......@@ -20,13 +20,15 @@ export default {
},
watch: {
value(val) {
if (this.ckEditor.getData() !== val) {
if (this.ckEditor && this.ckEditor.getData() !== val) {
this.ckEditor.setData(val)
}
},
disabled(val) {
if (this.ckEditor && this.ckEditor.instanceReady) {
this.ckEditor.setReadOnly(val)
}
}
},
methods: {
createEditor() {
......@@ -97,7 +99,6 @@ export default {
editor.setData(data, {
callback: () => {
editor.setReadOnly(this.disabled)
this.bindEvent()
const newData = editor.getData()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论