fix(Tinymce): When content is null,set content to '' to avoid error (#732)
When get rich editor value(null) from backend,it will occur error ``` Error in nextTick: "TypeError: Cannot read property 'replace' of null" ``` So I set val to '' to avoid it
This commit is contained in:
parent
31d9da8b9f
commit
a7942636c6
|
@ -50,7 +50,8 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
if (!this.hasChange && this.hasInit) {
|
if (!this.hasChange && this.hasInit) {
|
||||||
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val))
|
this.$nextTick(() =>
|
||||||
|
window.tinymce.get(this.tinymceId).setContent(val || ''))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue