mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +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) {
|
||||
// Get vue-meta context
|
||||
let head
|
||||
if (typeof this.options.head === 'function') {
|
||||
head = this.options.head()
|
||||
} else {
|
||||
head = cloneDeep(this.options.head)
|
||||
}
|
||||
renderContext.head = typeof this.options.head === 'function'
|
||||
? this.options.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
|
||||
meta.HTML_ATTRS = m.htmlAttrs.text()
|
||||
|
Loading…
Reference in New Issue
Block a user