From 967d29389a71e14ddca5d7283c22d4395f8d4396 Mon Sep 17 00:00:00 2001 From: Arlo Date: Sun, 19 May 2024 23:55:34 +0800 Subject: [PATCH] fix: page can't navigation, revert #357 This reverts commit a12c816ed39e393a8f6778242e7e3905206f2ceb. --- packages/devtools-kit/src/core/index.ts | 7 +------ packages/playground/multi-app/src/main.ts | 8 +++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/devtools-kit/src/core/index.ts b/packages/devtools-kit/src/core/index.ts index 28071dfb..d60884a0 100644 --- a/packages/devtools-kit/src/core/index.ts +++ b/packages/devtools-kit/src/core/index.ts @@ -56,7 +56,7 @@ export function initDevTools() { }, ] - if (devtoolsAppRecords.value.length >= 1) { + if (devtoolsAppRecords.value.length === 1) { await setActiveAppRecord(devtoolsAppRecords.value[0]) devtoolsState.connected = true devtoolsHooks.callHook(DevToolsHooks.APP_CONNECTED) @@ -65,11 +65,6 @@ export function initDevTools() { hook.on.vueAppUnmount(async (app) => { const activeRecords = devtoolsAppRecords.value.filter(appRecord => appRecord.app !== app) - // #356 should disconnect when all apps are unmounted - if (activeRecords.length === 0) { - devtoolsState.connected = false - return - } devtoolsAppRecords.value = activeRecords if (devtoolsAppRecords.active.app === app) await setActiveAppRecord(activeRecords[0]) diff --git a/packages/playground/multi-app/src/main.ts b/packages/playground/multi-app/src/main.ts index 65ea9acb..61ab5943 100644 --- a/packages/playground/multi-app/src/main.ts +++ b/packages/playground/multi-app/src/main.ts @@ -8,10 +8,8 @@ import 'uno.css' const app = createApp(App) +const app2 = createApp(App2) + app.mount('#app') -setTimeout(() => { - app.unmount() - app.mount('#app') - createApp(App2).mount('#app2') -}, 500) +app2.mount('#app2')