Skip to content

Commit 2248387

Browse files
committed
chore: fix dev iframe reload
1 parent 5bb621b commit 2248387

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/shell-host/src/DevIframe.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,19 @@ export default defineComponent({
3232
iframe.value.contentDocument.body.appendChild(script)
3333
}
3434
35+
let init = false
36+
let loadListener
37+
38+
3539
function onLoad() {
3640
loading.value = false
41+
if (init) {
42+
if (loadListener) {
43+
loadListener()
44+
}
45+
return
46+
}
47+
init = true
3748
3849
if (!iframe.value?.contentWindow) {
3950
throw new Error('Cant find iframe contentWindow')
@@ -42,8 +53,6 @@ export default defineComponent({
4253
console.log('%cInstalling hook...', 'color:#42B983;')
4354
installHook(iframe.value.contentWindow)
4455
45-
let loadListener
46-
4756
// 2. init devtools
4857
console.log('%cInit devtools...', 'color:#42B983;')
4958
initDevTools({

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy