Skip to content

Commit

Permalink
fix: add teleports body element
Browse files Browse the repository at this point in the history
  • Loading branch information
yooouuri committed Dec 21, 2023
1 parent f080cd2 commit 04bd810
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugin/generateHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ export async function generateHtml(template: string,
$('body').append(`<script>window.__INITIAL_STATE__ = ${devalue(state.value)}</script>`)
}

const teleports = ctx.teleports ?? {}

if (teleports['#teleports'] !== undefined) {
$('body').append(`<div id="teleports">${teleports['#teleports']}</div>`)
}

const resolvedTags = await head.resolveTags()

let tags = ['title', 'meta', 'link', 'base', 'style', 'script', 'noscript']
Expand Down

0 comments on commit 04bd810

Please sign in to comment.