Skip to content

Commit 501e552

Browse files
committed
fix(Preview): fixing incorrect styles during onMounted vuejs#191
1 parent 6e5ef99 commit 501e552

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
@@ -232,10 +232,8 @@ async function updatePreview() {
232232
previewOptions?.bodyHTML || ''
233233
}\``),
234234
...modules,
235-
`setTimeout(()=> {
236-
document.querySelectorAll('style[css]').forEach(el => el.remove())
237-
document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`<style css>\${s}</style>\`).join('\\n'))
238-
}, 1)`,
235+
`document.querySelectorAll('style[css]').forEach(el => el.remove())
236+
document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`<style css>\${s}</style>\`).join('\\n'))`,
239237
]
240238
241239
// if main file is a vue file, mount it.

0 commit comments

Comments
 (0)