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:
Insua 2018-06-01 15:38:08 +08:00 committed by 花裤衩
parent 31d9da8b9f
commit a7942636c6

View file

@ -50,7 +50,8 @@ export default {
watch: {
value(val) {
if (!this.hasChange && this.hasInit) {
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val))
this.$nextTick(() =>
window.tinymce.get(this.tinymceId).setContent(val || ''))
}
}
},