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(){
bus.$on('fieldSelect-' + this.element.propValue.viewId, this.fieldSelect)
tinymce.init({})
this.myValue = this.assignment(this.element.propValue.textValue)
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
this.$nextTick(()=>{
this.myValue = this.assignment(this.element.propValue.textValue)
bus.$on('initCurFields-' + this.element.id, this.initCurFieldsChange)
this.initReady=true
})
},
@ -170,19 +170,21 @@ export default {
},
resetSelect(node){
const edInner = tinymce.get(this.tinymceId);
const nodeArray = edInner.dom.select(".base-selected")
if(nodeArray){
nodeArray.forEach(nodeInner=>{
nodeInner.removeAttribute('class')
})
}
if(node){
const pNode = node.parentElement
if(pNode && pNode.id&& pNode.id.indexOf('changeText')>-1){
const innerId = '#'+pNode.id
const domTest = edInner.dom.select(innerId)[0]
domTest.setAttribute("class",'base-selected')
edInner.selection.select(domTest)
if(edInner.dom){
const nodeArray = edInner.dom.select(".base-selected")
if(nodeArray){
nodeArray.forEach(nodeInner=>{
nodeInner.removeAttribute('class')
})
}
if(node){
const pNode = node.parentElement
if(pNode && pNode.id&& pNode.id.indexOf('changeText')>-1){
const innerId = '#'+pNode.id
const domTest = edInner.dom.select(innerId)[0]
domTest.setAttribute("class",'base-selected')
edInner.selection.select(domTest)
}
}
}
},

View File

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