Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0369952

Browse files
陆德靖陆德靖
陆德靖
authored and
陆德靖
committed
fix: update app initialization logic in devtools container management
1 parent 06f5d42 commit 0369952

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎packages/overlay/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Component, App as VueAppType } from 'vue'
22
import { createApp, h } from 'vue'
33
import App from './App.vue'
44

5-
let app: VueAppType
5+
let app: VueAppType|null=null
66
function createDevToolsContainer(App: Component) {
77
const CONTAINER_ID = '__vue-devtools-container__'
88
const el = document.createElement('div')
@@ -25,15 +25,15 @@ const config = { childList: true, attributes: false }
2525
const observer = new MutationObserver(callback)
2626
observer.observe(targetNode, config)
2727

28-
let init = false
28+
let isInitialized = false
2929
function callback(mutationsList, observer) {
3030
for (const mutation of mutationsList) {
31-
if (mutation.type === 'childList' && init === false) {
31+
if (mutation.type === 'childList' && isInitialized === false) {
3232
if (app) {
3333
app.unmount()
3434
}
3535
createDevToolsContainer(App)
36-
init = true
36+
isInitialized = true
3737
observer.disconnect()
3838
}
3939
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /