Skip to content

Commit ece4414

Browse files
fix(Preview): fix style loading delay (#191)
1 parent b1594d0 commit ece4414

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/output/Preview.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,8 @@ async function updatePreview() {
228228
previewOptions?.bodyHTML || ''
229229
}\``),
230230
...modules,
231-
`setTimeout(()=> {
232-
document.querySelectorAll('style[css]').forEach(el => el.remove())
233-
document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`<style css>\${s}</style>\`).join('\\n'))
234-
}, 1)`,
231+
`document.querySelectorAll('style[css]').forEach(el => el.remove())
232+
document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`<style css>\${s}</style>\`).join('\\n'))`,
235233
]
236234
237235
// if main file is a vue file, mount it.

0 commit comments

Comments
 (0)