chore: types

This commit is contained in:
Sébastien Chopin 2024-01-05 17:28:15 +01:00
parent d62ca46457
commit a49cad2362
2 changed files with 2 additions and 1 deletions

View File

@ -322,6 +322,7 @@ export function useAsyncData<
// Setup hook callbacks once per instance
const instance = getCurrentInstance()
if (import.meta.dev && !nuxt.isHydrating && (!instance || instance?.isMounted)) {
// @ts-expect-error private property
console.warn(`[nuxt] [${options._useFetch ? 'useFetch' : 'useAsyncData'}] Component is already mounted, please use $fetch instead. See https://nuxt.com/docs/getting-started/data-fetching`)
}
if (instance && !instance._nuxtOnBeforeMountCbs) {

View File

@ -144,7 +144,7 @@ export function useFetch<
getCachedData,
deep,
watch: watch === false ? [] : [_fetchOptions, _request, ...(watch || [])],
// @ts-expect-error private method
// @ts-expect-error private property
_useFetch: true
}