From a35c98b03e9132e362b9c15c2034b383cc71b8dd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 22 Apr 2024 15:10:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B8=83=E5=B1=80=E5=90=8E?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=97=A0=E6=B3=95=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E5=90=91tab=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/de-tabs/Component.vue | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/core-frontend/src/custom-component/de-tabs/Component.vue b/core/core-frontend/src/custom-component/de-tabs/Component.vue index 9c1ce42381..86b453b4c8 100644 --- a/core/core-frontend/src/custom-component/de-tabs/Component.vue +++ b/core/core-frontend/src/custom-component/de-tabs/Component.vue @@ -264,16 +264,18 @@ const componentMoveIn = component => { dvMainStore.setCurComponent({ component: null, index: null }) component.canvasId = element.value.id + '--' + tabItem.name const refInstance = currentInstance.refs['tabCanvas_' + index][0] - const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小 - canvasChangeAdaptor(component, matrixBase) - tabItem.componentData.push(component) - nextTick(() => { - component.x = 1 - component.y = 1 - component.style.left = 0 - component.style.top = 0 - refInstance.addItemBox(component) //在适当的时候初始化布局组件 - }) + if (refInstance) { + const matrixBase = refInstance.getBaseMatrixSize() //矩阵基础大小 + canvasChangeAdaptor(component, matrixBase) + tabItem.componentData.push(component) + nextTick(() => { + component.x = 1 + component.y = 1 + component.style.left = 0 + component.style.top = 0 + refInstance.addItemBox(component) //在适当的时候初始化布局组件 + }) + } } }) }