fix(仪表板): 修复富文本视图初始化延迟导致内容不显示的问题

This commit is contained in:
wangjiahao 2022-08-24 18:32:59 +08:00
parent da7dc55edb
commit 67678c9045
2 changed files with 17 additions and 16 deletions

View File

@ -131,9 +131,9 @@ export default {
viewInit(){ viewInit(){
bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect) bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect)
tinymce.init({}) tinymce.init({})
this.$nextTick(()=>{
this.myValue = this.assignment(this.element.propValue.textValue) this.myValue = this.assignment(this.element.propValue.textValue)
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange) bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
this.$nextTick(()=>{
this.initReady=true this.initReady=true
}) })
}, },
@ -170,6 +170,7 @@ export default {
}, },
resetSelect(node){ resetSelect(node){
const edInner = tinymce.get(this.tinymceId); const edInner = tinymce.get(this.tinymceId);
if(edInner.dom){
const nodeArray = edInner.dom.select(".base-selected") const nodeArray = edInner.dom.select(".base-selected")
if(nodeArray){ if(nodeArray){
nodeArray.forEach(nodeInner=>{ nodeArray.forEach(nodeInner=>{
@ -185,6 +186,7 @@ export default {
edInner.selection.select(domTest) edInner.selection.select(domTest)
} }
} }
}
}, },
setEdit() { setEdit() {
if (this.editStatus&&this.canEdit===false) { if (this.editStatus&&this.canEdit===false) {

View File

@ -1399,7 +1399,6 @@ export default {
} }
.this_mobile_canvas_cell { .this_mobile_canvas_cell {
text-align: center;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;