fix(devtools): allow setting devtools hook after createApp (#13580)
ci / test (push) Waiting to run Details
ci / continuous-release (push) Waiting to run Details
size data / upload (push) Waiting to run Details

This commit is contained in:
edison 2025-07-09 08:45:09 +08:00 committed by GitHub
parent a5379e23f5
commit 6dc07a8922
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 5 deletions

View 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) => {