From da1090562799e5d3a7173b28e7fbd4d3e32c6756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E8=B6=8A?= <552369664@qq.com> Date: Wed, 16 Jul 2025 16:22:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E5=95=86=E5=9F=8E=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E3=80=91=E5=88=A0=E9=99=A4=E2=80=9C=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E2=80=9D=E5=90=8E=E5=88=87=E6=8D=A2=E5=88=B0?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=AE=BE=E7=BD=AE=E9=A1=B5=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DiyEditor/index.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/DiyEditor/index.vue b/src/components/DiyEditor/index.vue index 27d3fc11..082395a9 100644 --- a/src/components/DiyEditor/index.vue +++ b/src/components/DiyEditor/index.vue @@ -269,6 +269,10 @@ watch( if (!val || selectedComponentIndex.value === -1) { return } + // 如果是基础设置页,默认选中的索引改成-1,为了防止删除组件后切换到此页导致报错 + if (props.showTabBar) { + selectedComponentIndex.value = -1 + } pageComponents.value[selectedComponentIndex.value] = selectedComponent.value! }, { deep: true }