mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(vue-app): use nuxt globalName correctly in nuxt-link and fetch mixin (#8289)
This commit is contained in:
parent
e14b7201b4
commit
442b6c07c9
@ -111,8 +111,8 @@ export default {
|
||||
// Preload the data only if not in preview mode
|
||||
if (!this.$root.isPreview) {
|
||||
const { href } = this.$router.resolve(this.to, this.$route, this.append)
|
||||
if (this.$nuxt)
|
||||
this.$nuxt.fetchPayload(href).catch(() => {})
|
||||
if (this.<%= globals.nuxt %>)
|
||||
this.<%= globals.nuxt %>.fetchPayload(href).catch(() => {})
|
||||
}
|
||||
<% } %>
|
||||
<% if (router.linkPrefetchedClass) { %>
|
||||
|
@ -60,12 +60,12 @@ function createdFullStatic() {
|
||||
if (typeof this.$options.fetchOnServer === 'function') {
|
||||
fetchedOnServer = this.$options.fetchOnServer.call(this) !== false
|
||||
}
|
||||
if (!fetchedOnServer || this.$nuxt.isPreview || !this.$nuxt._pagePayload) {
|
||||
if (!fetchedOnServer || this.<%= globals.nuxt %>.isPreview || !this.<%= globals.nuxt %>._pagePayload) {
|
||||
return
|
||||
}
|
||||
this._hydrated = true
|
||||
this._fetchKey = this.$nuxt._payloadFetchIndex++
|
||||
const data = this.$nuxt._pagePayload.fetch[this._fetchKey]
|
||||
this._fetchKey = this.<%= globals.nuxt %>._payloadFetchIndex++
|
||||
const data = this.<%= globals.nuxt %>._pagePayload.fetch[this._fetchKey]
|
||||
|
||||
// If fetch error
|
||||
if (data && data._error) {
|
||||
|
Loading…
Reference in New Issue
Block a user