Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
fix(#85): compatible with nuxt 2.14.7
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoDanin committed Nov 14, 2020
1 parent 8a9477f commit e4b6aa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ module.exports = function (moduleOptions) {

this.options.head.title = createTitle(options)
this.options.head.meta = createMeta(options, this.options.head.meta, template)
this.options.head.link = createCanonical(options, '/').concat(this.options.head.link || []);
this.options.head.link = createCanonical(options, '/').concat(this.options.head.link || [])

const pluginOptions = {
moduleOptions: options,
Expand Down
5 changes: 4 additions & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ export default function (ctx, inject) {
}

if (Vue.prototype && Vue.prototype.$meta) { // Vue-meta is enabled
if (Vue.prototype.$nuxt && Vue.prototype.$nuxt.$options && Vue.prototype.$nuxt.$options.head) {
if (this.$nuxt && this.$nuxt.$options && this.$nuxt.$options.head) {
this.$nuxt.$options.head = ctx.app.head
} else if (Vue.prototype.$nuxt && Vue.prototype.$nuxt.$options && Vue.prototype.$nuxt.$options.head) {
Vue.prototype.$nuxt.$options.head = ctx.app.head
}
}

deb('HEAD:', ctx.app.head)
return ctx.app.head
}
Expand Down

0 comments on commit e4b6aa1

Please sign in to comment.