From: edison Date: Wed, 9 Jul 2025 00:45:09 +0000 (+0800) Subject: fix(devtools): allow setting devtools hook after createApp (#13580) X-Git-Tag: v3.6.0-alpha.1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dc07a89224d3d0dc650289395a876e9ff66baab;p=thirdparty%2Fvuejs%2Fcore.git fix(devtools): allow setting devtools hook after createApp (#13580) --- diff --git a/packages/runtime-core/src/devtools.ts b/packages/runtime-core/src/devtools.ts index cf7b1973c4..8b300f6955 100644 --- a/packages/runtime-core/src/devtools.ts +++ b/packages/runtime-core/src/devtools.ts @@ -49,11 +49,7 @@ function emit(event: string, ...args: any[]) { } } -let queued = false export function setDevtoolsHook(hook: DevtoolsHook, target: any): void { - if (devtoolsNotInstalled || queued) { - return - } devtools = hook if (devtools) { devtools.enabled = true @@ -70,7 +66,6 @@ export function setDevtoolsHook(hook: DevtoolsHook, target: any): void { // eslint-disable-next-line no-restricted-syntax !window.navigator?.userAgent?.includes('jsdom') ) { - queued = true const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []) replay.push((newHook: DevtoolsHook) => {