Skip to content

Commit

Permalink
chore: fix dev iframe reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed May 31, 2024
1 parent 5bb621b commit 2248387
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/shell-host/src/DevIframe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,19 @@ export default defineComponent({
iframe.value.contentDocument.body.appendChild(script)
}
let init = false
let loadListener
function onLoad() {
loading.value = false
if (init) {
if (loadListener) {
loadListener()
}
return
}
init = true
if (!iframe.value?.contentWindow) {
throw new Error('Cant find iframe contentWindow')
Expand All @@ -42,8 +53,6 @@ export default defineComponent({
console.log('%cInstalling hook...', 'color:#42B983;')
installHook(iframe.value.contentWindow)
let loadListener
// 2. init devtools
console.log('%cInit devtools...', 'color:#42B983;')
initDevTools({
Expand Down

0 comments on commit 2248387

Please sign in to comment.