刷新部件时简版部件位置不正确问题

This commit is contained in:
猴赛雷 2024-10-17 17:11:15 +08:00
parent 8776a8bb45
commit 416f11a91b
3 changed files with 28 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ddei-editor",
"version": "1.2.41-210",
"version": "1.2.41-211-2",
"private": false,
"type": "module",
"author": "hoslay <3697355039@qq.com>",

View File

@ -58,6 +58,7 @@ export default {
},
data() {
return {
groups:null,
forceRefresh: true,
forceRefreshGroup: true,
};
@ -76,7 +77,8 @@ export default {
//
const { width, height } = entry.contentRect;
if (width != 0 && height != 0) {
this.width = width
this.height = height
this.resetPosition(width,height)
}
@ -182,29 +184,27 @@ export default {
this.editor.ddInstance.initRender()
}
//groups
let groups = []
for(let i = 0;i < this.options?.groups?.length;i++){
let group = clone(this.options.groups[i])
let controls = []
group.controls?.forEach(controlid => {
let control = this.editor.controls.get(controlid)
if(control){
controls.push(control)
if(!this.groups){
let groups = []
for(let i = 0;i < this.options?.groups?.length;i++){
let group = clone(this.options.groups[i])
let controls = []
group.controls?.forEach(controlid => {
let control = this.editor.controls.get(controlid)
if(control){
controls.push(control)
}
});
if (controls.length > 0){
group.controls = controls;
}
});
if (controls.length > 0){
group.controls = controls;
groups.push(group)
}
groups.push(group)
this.groups = groups
}
this.groups = groups
this.forceRefresh = false
this.$nextTick(() => {
this.forceRefresh = true;
});
},
//
@ -214,7 +214,9 @@ export default {
this.$nextTick(() => {
this.forceRefresh = true;
if (this.refreshData) {
this.refreshData();
this.$nextTick(() => {
this.resetPosition(this.width,this.height)
});
}
});
}

View File

@ -73,7 +73,8 @@ export default {
//
const { width, height } = entry.contentRect;
if (width != 0 && height != 0) {
this.width = width
this.height = height
this.resetPosition(width,height)
}
@ -428,6 +429,9 @@ export default {
this.forceRefresh = true;
if (this.refreshData) {
this.refreshData();
this.$nextTick(() => {
this.resetPosition(this.width, this.height)
})
}
});
}