]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(devtools): allow setting devtools hook after createApp (#13580)
authoredison <daiwei521@126.com>
Wed, 9 Jul 2025 00:45:09 +0000 (08:45 +0800)
committerGitHub <noreply@github.com>
Wed, 9 Jul 2025 00:45:09 +0000 (08:45 +0800)
packages/runtime-core/src/devtools.ts

index cf7b1973c427f881eba22a3ef43e522a67273608..8b300f6955b3fdd67f717e52ace26b07c7655f60 100644 (file)
@@ -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) => {