浏览代码

fix(devtools): allow setting devtools hook after createApp (#13580)

edison 9 月之前
父节点
当前提交
6dc07a8922
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      packages/runtime-core/src/devtools.ts

+ 0 - 5
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) => {