mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix: fix on page change
This commit is contained in:
parent
c62776b2e4
commit
211900eb31
@ -67,21 +67,22 @@ export default defineComponent({
|
|||||||
type: String,
|
type: String,
|
||||||
default: () => undefined,
|
default: () => undefined,
|
||||||
},
|
},
|
||||||
|
dangerouslyLoadClientComponents: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* use the NuxtIslandResponse which has been cached if available
|
* use the NuxtIslandResponse which has been cached if available
|
||||||
* @default true
|
* @default true
|
||||||
*/
|
*/
|
||||||
useCache: {
|
useCache: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
},
|
|
||||||
dangerouslyLoadClientComponents: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['error'],
|
emits: ['error'],
|
||||||
async setup (props, { slots, expose, emit }) {
|
async setup (props, { slots, expose, emit }) {
|
||||||
|
console.log(props.useCache)
|
||||||
let canTeleport = import.meta.server
|
let canTeleport = import.meta.server
|
||||||
const teleportKey = ref(0)
|
const teleportKey = ref(0)
|
||||||
const key = ref(0)
|
const key = ref(0)
|
||||||
@ -194,9 +195,7 @@ export default defineComponent({
|
|||||||
appendResponseHeader(event!, 'x-nitro-prerender', hints)
|
appendResponseHeader(event!, 'x-nitro-prerender', hints)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (import.meta.client) {
|
setPayload(key, result)
|
||||||
setPayload(key, result)
|
|
||||||
}
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,9 +250,9 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.client && !instance.vnode.el && props.lazy) {
|
if (import.meta.client && !instance.vnode.el && props.lazy) {
|
||||||
fetchComponent()
|
fetchComponent(!instance.vnode.el && !props.useCache)
|
||||||
} else if (import.meta.server || !instance.vnode.el || !nuxtApp.payload.serverRendered) {
|
} else if (import.meta.server || !instance.vnode.el || !nuxtApp.payload.serverRendered) {
|
||||||
await fetchComponent()
|
await fetchComponent(!instance.vnode.el && !props.useCache)
|
||||||
} else if (selectiveClient && canLoadClientComponent.value) {
|
} else if (selectiveClient && canLoadClientComponent.value) {
|
||||||
await loadComponents(props.source, payloads.components)
|
await loadComponents(props.source, payloads.components)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user