From ece4414186fab8bb19290ed047e2a4ab665ae3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=B6=E8=BF=9C=E6=96=B9?= Date: Wed, 3 Jan 2024 16:52:16 +0800 Subject: [PATCH] fix(Preview): fix style loading delay (#191) --- src/output/Preview.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/output/Preview.vue b/src/output/Preview.vue index d69f08a1..3fad502e 100644 --- a/src/output/Preview.vue +++ b/src/output/Preview.vue @@ -228,10 +228,8 @@ async function updatePreview() { previewOptions?.bodyHTML || '' }\``), ...modules, - `setTimeout(()=> { - document.querySelectorAll('style[css]').forEach(el => el.remove()) - document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`\`).join('\\n')) - }, 1)`, + `document.querySelectorAll('style[css]').forEach(el => el.remove()) + document.head.insertAdjacentHTML('beforeend', window.__css__.map(s => \`\`).join('\\n'))`, ] // if main file is a vue file, mount it.