mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +00:00
feat(vue-renderer): add vue-renderer:spa:prepareContext
hook (#7633)
[release]
This commit is contained in:
parent
c5465e65c8
commit
124cb0994a
@ -51,14 +51,16 @@ export default class SPARenderer extends BaseRenderer {
|
|||||||
|
|
||||||
if (this.options.features.meta) {
|
if (this.options.features.meta) {
|
||||||
// Get vue-meta context
|
// Get vue-meta context
|
||||||
let head
|
renderContext.head = typeof this.options.head === 'function'
|
||||||
if (typeof this.options.head === 'function') {
|
? this.options.head()
|
||||||
head = this.options.head()
|
: cloneDeep(this.options.head)
|
||||||
} else {
|
}
|
||||||
head = cloneDeep(this.options.head)
|
|
||||||
}
|
|
||||||
|
|
||||||
const m = VueMeta.generate(head || {}, this.vueMetaConfig)
|
// Allow overriding renderContext
|
||||||
|
await this.serverContext.nuxt.callHook('vue-renderer:spa:prepareContext', renderContext)
|
||||||
|
|
||||||
|
if (this.options.features.meta) {
|
||||||
|
const m = VueMeta.generate(renderContext.head || {}, this.vueMetaConfig)
|
||||||
|
|
||||||
// HTML_ATTRS
|
// HTML_ATTRS
|
||||||
meta.HTML_ATTRS = m.htmlAttrs.text()
|
meta.HTML_ATTRS = m.htmlAttrs.text()
|
||||||
|
Loading…
Reference in New Issue
Block a user