Skip to content

Commit

Permalink
fix: fix html initialization in ssr mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 25, 2022
1 parent 6023935 commit 152f2fa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/output/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ async function updatePreview() {
const codeToEval = [
`window.__modules__ = {};window.__css__ = '';` +
`if (window.__app__) window.__app__.unmount();` +
isSSR
? ``
: `document.body.innerHTML = '<div id="app"></div>'`,
`if (window.__app__) window.__app__.unmount();` +
(isSSR ? `` : `document.body.innerHTML = '<div id="app"></div>'`),
...modules,
`document.getElementById('__sfc-styles').innerHTML = window.__css__`
]
Expand Down

0 comments on commit 152f2fa

Please sign in to comment.