diff --git a/package.json b/package.json index 4586401..cddecce 100644 --- a/package.json +++ b/package.json @@ -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>", diff --git a/plugins/core/panels/simple/ToolboxSimple.vue b/plugins/core/panels/simple/ToolboxSimple.vue index 6016baa..3ad0cb3 100644 --- a/plugins/core/panels/simple/ToolboxSimple.vue +++ b/plugins/core/panels/simple/ToolboxSimple.vue @@ -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) + }); } }); } diff --git a/plugins/core/panels/simple/TopMenuSimple.vue b/plugins/core/panels/simple/TopMenuSimple.vue index f525706..30b8ec0 100644 --- a/plugins/core/panels/simple/TopMenuSimple.vue +++ b/plugins/core/panels/simple/TopMenuSimple.vue @@ -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) + }) } }); }