mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(vue-app): use mixin to provide this.$nuxt
(#8068)
Co-authored-by: Clark Du <clark.duxin@gmail.com>
This commit is contained in:
parent
79440f3ce5
commit
8abdc177be
@ -24,6 +24,14 @@ if (!Vue.__nuxt__fetch__mixin__) {
|
||||
}
|
||||
<% } %>
|
||||
|
||||
Vue.mixin({
|
||||
beforeCreate() {
|
||||
if(Vue.prototype.<%= globals.nuxt %>) {
|
||||
this.<%= globals.nuxt %> = Vue.prototype.<%= globals.nuxt %>
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Component: <NuxtLink>
|
||||
Vue.component(NuxtLink.name, NuxtLink)
|
||||
<% if (features.componentAliases) { %>Vue.component('NLink', NuxtLink)<% } %>
|
||||
|
Loading…
Reference in New Issue
Block a user