Commit 68e220a9 by 潘际乾

保函文本组件完善

parent 41befe47
...@@ -19,22 +19,28 @@ export default { ...@@ -19,22 +19,28 @@ export default {
}; };
}, },
watch: { watch: {
model() { model: function (newVal, oldVal) {
this.updateValue();
},
},
mounted() {
this.updateValue();
},
methods: {
updateValue() {
let rows = this.model["rows"] || []; let rows = this.model["rows"] || [];
let enabled = false let enabled = false;
if (this.$refs.editor.quill) { if (this.$refs.editor.quill) {
enabled = this.$refs.editor.quill.isEnabled() enabled = this.$refs.editor.quill.isEnabled();
this.$refs.editor.quill.enable(false) this.$refs.editor.quill.enable(false);
} }
this.value = this.show(rows); this.value = this.show(rows);
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.editor.quill) { if (this.$refs.editor.quill) {
this.$refs.editor.quill.enable(enabled) this.$refs.editor.quill.enable(enabled);
} }
}) });
},
}, },
methods: {
// 修改文本后的失去焦点事件 // 修改文本后的失去焦点事件
blurEvent(quill) { blurEvent(quill) {
if (this.model && this.model.rows) { if (this.model && this.model.rows) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment