mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-07 01:28:28 +08:00
刷新部件时简版部件位置不正确问题
This commit is contained in:
parent
8776a8bb45
commit
416f11a91b
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.41-210",
|
"version": "1.2.41-211-2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "hoslay <3697355039@qq.com>",
|
"author": "hoslay <3697355039@qq.com>",
|
||||||
|
|||||||
@ -58,6 +58,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
groups:null,
|
||||||
forceRefresh: true,
|
forceRefresh: true,
|
||||||
forceRefreshGroup: true,
|
forceRefreshGroup: true,
|
||||||
};
|
};
|
||||||
@ -76,7 +77,8 @@ export default {
|
|||||||
// 获取宽度和高度
|
// 获取宽度和高度
|
||||||
const { width, height } = entry.contentRect;
|
const { width, height } = entry.contentRect;
|
||||||
if (width != 0 && height != 0) {
|
if (width != 0 && height != 0) {
|
||||||
|
this.width = width
|
||||||
|
this.height = height
|
||||||
this.resetPosition(width,height)
|
this.resetPosition(width,height)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -182,29 +184,27 @@ export default {
|
|||||||
this.editor.ddInstance.initRender()
|
this.editor.ddInstance.initRender()
|
||||||
}
|
}
|
||||||
//根据初始化参数,初始化groups
|
//根据初始化参数,初始化groups
|
||||||
let groups = []
|
if(!this.groups){
|
||||||
for(let i = 0;i < this.options?.groups?.length;i++){
|
let groups = []
|
||||||
let group = clone(this.options.groups[i])
|
for(let i = 0;i < this.options?.groups?.length;i++){
|
||||||
let controls = []
|
let group = clone(this.options.groups[i])
|
||||||
group.controls?.forEach(controlid => {
|
let controls = []
|
||||||
let control = this.editor.controls.get(controlid)
|
group.controls?.forEach(controlid => {
|
||||||
if(control){
|
let control = this.editor.controls.get(controlid)
|
||||||
controls.push(control)
|
if(control){
|
||||||
|
controls.push(control)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (controls.length > 0){
|
||||||
|
group.controls = controls;
|
||||||
}
|
}
|
||||||
});
|
groups.push(group)
|
||||||
if (controls.length > 0){
|
|
||||||
group.controls = controls;
|
|
||||||
}
|
|
||||||
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.$nextTick(() => {
|
||||||
this.forceRefresh = true;
|
this.forceRefresh = true;
|
||||||
if (this.refreshData) {
|
if (this.refreshData) {
|
||||||
this.refreshData();
|
this.$nextTick(() => {
|
||||||
|
this.resetPosition(this.width,this.height)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,8 @@ export default {
|
|||||||
// 获取宽度和高度
|
// 获取宽度和高度
|
||||||
const { width, height } = entry.contentRect;
|
const { width, height } = entry.contentRect;
|
||||||
if (width != 0 && height != 0) {
|
if (width != 0 && height != 0) {
|
||||||
|
this.width = width
|
||||||
|
this.height = height
|
||||||
this.resetPosition(width,height)
|
this.resetPosition(width,height)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -428,6 +429,9 @@ export default {
|
|||||||
this.forceRefresh = true;
|
this.forceRefresh = true;
|
||||||
if (this.refreshData) {
|
if (this.refreshData) {
|
||||||
this.refreshData();
|
this.refreshData();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.resetPosition(this.width, this.height)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user