From 3fe83f9fa49676cc89e9f2d799d0fbe3fd7f2ec6 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 28 Feb 2024 16:38:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E4=BB=8E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=88=90=E9=A1=B5=E9=9D=A2=E7=89=87=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=A1=B5=E9=9D=A2=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/layouts/page-bar/PageBar.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/layouts/page-bar/PageBar.vue b/packages/editor/src/layouts/page-bar/PageBar.vue index 50fc2513..b60031ef 100644 --- a/packages/editor/src/layouts/page-bar/PageBar.vue +++ b/packages/editor/src/layouts/page-bar/PageBar.vue @@ -123,7 +123,7 @@ watch( watch(active, (active) => { if (active === NodeType.PAGE) { - if (!activePage.value) { + if (!activePage.value && !pageList.value.length) { editorService?.selectRoot(); return; } @@ -132,11 +132,12 @@ watch(active, (active) => { } if (active === NodeType.PAGE_FRAGMENT) { - if (!activePageFragment.value) { + // 之前没有选中过页面片并且当前没有页面片 + if (!activePageFragment.value && !pageFragmentList.value.length) { editorService?.selectRoot(); return; } - switchPage(activePageFragment.value); + switchPage(activePageFragment.value || pageFragmentList.value[0].id); } });