mirror of https://github.com/nuxt/nuxt.git
refactor(nuxt): use `unref` in `fetch.ts` (#7813)
This commit is contained in:
parent
30277da960
commit
a68a7fe07d
|
@ -1,6 +1,6 @@
|
||||||
import type { FetchError, FetchOptions } from 'ohmyfetch'
|
import type { FetchError, FetchOptions } from 'ohmyfetch'
|
||||||
import type { TypedInternalResponse, NitroFetchRequest } from 'nitropack'
|
import type { TypedInternalResponse, NitroFetchRequest } from 'nitropack'
|
||||||
import { computed, isRef, Ref } from 'vue'
|
import { computed, unref, Ref } from 'vue'
|
||||||
import type { AsyncDataOptions, _Transform, KeyOfRes, AsyncData, PickFrom } from './asyncData'
|
import type { AsyncDataOptions, _Transform, KeyOfRes, AsyncData, PickFrom } from './asyncData'
|
||||||
import { useAsyncData } from './asyncData'
|
import { useAsyncData } from './asyncData'
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ export function useFetch<
|
||||||
if (typeof r === 'function') {
|
if (typeof r === 'function') {
|
||||||
r = r()
|
r = r()
|
||||||
}
|
}
|
||||||
return (isRef(r) ? r.value : r)
|
return unref(r)
|
||||||
})
|
})
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
Loading…
Reference in New Issue