hookehuyr

🐞 fix: 富文本控件获取数据优化

<!--
* @Date: 2022-09-26 21:52:25
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-18 18:43:55
* @LastEditTime: 2022-10-26 11:31:30
* @FilePath: /swx/src/components/activity-editor.vue
* @Description: 文件描述
-->
......@@ -64,20 +64,20 @@ export default {
editorCtx: ''
}
},
watch: {
htmlContent (val) {
// 如果有传值,还原重新编辑
this.editorCtx.setContents({
html: val
})
}
},
methods: {
_onEditorReady: function () {
const that = this;
Taro.createSelectorQuery().select('#editor').context(function (res) {
that.editorCtx = res.context
}).exec();
// 如果有传值,还原重新编辑
if (this.htmlContent) {
setTimeout(() => {
this.editorCtx.setContents({
html: this.htmlContent
})
}, 1000);
}
},
//插入图片
_addImage: function (event) {
......