fix: 修改 text未正确保存的问题
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
</span>
|
||||
<div class="chart-header__title" v-if="!isGroup">{{chartInfo.name}}</div>
|
||||
<div class="chart-header__title" v-else >
|
||||
<span @click="groupShow"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-down': 'nz-icon-arrow-right'"></i></span>
|
||||
<span @click="groupShow"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-right': 'nz-icon-arrow-down'"></i></span>
|
||||
{{chartInfo.name}}
|
||||
</div>
|
||||
<div class="chart-header__tools" v-if="chartInfo.type !== 'endpointInfo' && chartInfo.type !== 'assetInfo'">
|
||||
|
||||
@@ -59,10 +59,11 @@ export default {
|
||||
$self.maxLength = $self.quill.getText().length
|
||||
$self.tooLong = false
|
||||
}
|
||||
$self.$emit('textChange', $self.quill.root.innerHTML)
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$emit('after-init')
|
||||
this.$emit('textChange')
|
||||
// this.$emit('textChange')
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -84,19 +85,11 @@ export default {
|
||||
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
editData: {
|
||||
immediate: true,
|
||||
handler (n, o) {
|
||||
this.$nextTick(() => {
|
||||
this.initEditor()
|
||||
this.quill.clipboard.dangerouslyPasteHTML(null, this.editData, 'api')
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initEditor()
|
||||
if (this.editData) {
|
||||
this.quill.clipboard.dangerouslyPasteHTML(null, this.editData, 'api')
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.quill.off('selection-change')
|
||||
|
||||
@@ -139,11 +139,12 @@ export default {
|
||||
richTextEditor
|
||||
},
|
||||
watch: {
|
||||
'chartConfig.param.text': {
|
||||
handler (n) {
|
||||
this.change()
|
||||
}
|
||||
}
|
||||
// 'chartConfig.param.text': {
|
||||
// handler (n) {
|
||||
// console.log(n)
|
||||
// this.change()
|
||||
// }
|
||||
// }
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -218,8 +219,10 @@ export default {
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
textChange () {
|
||||
this.chartConfig.param.text = this.$refs.richTextEditor.getContent()
|
||||
textChange (val) {
|
||||
const html = `<div class="editor-core ql-container ql-snow"><div class="ql-editor">${val}</div></div>`
|
||||
this.chartConfig.param.text = html
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
Reference in New Issue
Block a user