mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-01 18:07:22 +00:00
feat: support ssrContext.head
Co-Authored-By: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
387fa4a278
commit
6e9be0eece
@ -62,11 +62,15 @@ function renderHTML (payload, rendered, ssrContext) {
|
|||||||
const state = `<script>window.__NUXT__=${devalue(payload)}</script>`
|
const state = `<script>window.__NUXT__=${devalue(payload)}</script>`
|
||||||
const _html = rendered.html
|
const _html = rendered.html
|
||||||
|
|
||||||
|
const { htmlAttrs = '', bodyAttrs = '', headTags = '', headAttrs = '' } =
|
||||||
|
(ssrContext.head && ssrContext.head()) || {}
|
||||||
|
|
||||||
return htmlTemplate({
|
return htmlTemplate({
|
||||||
HTML_ATTRS: '',
|
HTML_ATTRS: htmlAttrs,
|
||||||
HEAD_ATTRS: '',
|
HEAD_ATTRS: headAttrs,
|
||||||
BODY_ATTRS: '',
|
BODY_ATTRS: bodyAttrs,
|
||||||
HEAD: rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''),
|
HEAD: headTags +
|
||||||
|
rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''),
|
||||||
APP: _html + state + rendered.renderScripts()
|
APP: _html + state + rendered.renderScripts()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user