refactor(nuxt): use unref in fetch.ts (#7813)

This commit is contained in:
菜狗 2022-09-26 17:13:30 +08:00 committed by GitHub
parent 30277da960
commit a68a7fe07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import type { FetchError, FetchOptions } from 'ohmyfetch'
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 { useAsyncData } from './asyncData'
@ -52,7 +52,7 @@ export function useFetch<
if (typeof r === 'function') {
r = r()
}
return (isRef(r) ? r.value : r)
return unref(r)
})
const {