mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 15:10:58 +00:00
refactor(nuxt): remove duplicated check (#26544)
This commit is contained in:
parent
22dfac7bd7
commit
9b243631b4
@ -351,13 +351,11 @@ export function useAsyncData<
|
|||||||
if (instance && !instance._nuxtOnBeforeMountCbs) {
|
if (instance && !instance._nuxtOnBeforeMountCbs) {
|
||||||
instance._nuxtOnBeforeMountCbs = []
|
instance._nuxtOnBeforeMountCbs = []
|
||||||
const cbs = instance._nuxtOnBeforeMountCbs
|
const cbs = instance._nuxtOnBeforeMountCbs
|
||||||
if (instance) {
|
onBeforeMount(() => {
|
||||||
onBeforeMount(() => {
|
cbs.forEach((cb) => { cb() })
|
||||||
cbs.forEach((cb) => { cb() })
|
cbs.splice(0, cbs.length)
|
||||||
cbs.splice(0, cbs.length)
|
})
|
||||||
})
|
onUnmounted(() => cbs.splice(0, cbs.length))
|
||||||
onUnmounted(() => cbs.splice(0, cbs.length))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fetchOnServer && nuxtApp.isHydrating && (asyncData.error.value || hasCachedData())) {
|
if (fetchOnServer && nuxtApp.isHydrating && (asyncData.error.value || hasCachedData())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user