From a68a7fe07dee304540bb20a739e42aa071a7817d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8B=97?= <95845542+yufanzheng0723@users.noreply.github.com> Date: Mon, 26 Sep 2022 17:13:30 +0800 Subject: [PATCH] refactor(nuxt): use `unref` in `fetch.ts` (#7813) --- packages/nuxt/src/app/composables/fetch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/fetch.ts b/packages/nuxt/src/app/composables/fetch.ts index 4529f5f525a..9b2b0294d10 100644 --- a/packages/nuxt/src/app/composables/fetch.ts +++ b/packages/nuxt/src/app/composables/fetch.ts @@ -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 {