From 28c5a95f81655949ba6a277cf9f6aa0782be8de2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 4 Aug 2022 11:50:24 +0800 Subject: [PATCH] fix: improve `MaybeComputedRef` --- packages/shared/utils/types.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/shared/utils/types.ts b/packages/shared/utils/types.ts index daabeaf9fa2..d0189383931 100644 --- a/packages/shared/utils/types.ts +++ b/packages/shared/utils/types.ts @@ -1,4 +1,4 @@ -import type { Ref, WatchOptions, WatchSource } from 'vue-demi' +import type { ComputedRef, Ref, WatchOptions, WatchSource } from 'vue-demi' /** * Any function @@ -34,9 +34,7 @@ export type MaybeRef = T | Ref * type MaybeComputedRef = T | Ref | (() => T) * ``` */ -export type MaybeComputedRef = T extends () => void - ? never - : (() => T) | MaybeRef +export type MaybeComputedRef = (() => T) | T | Ref | ComputedRef /** * Make all the nested attributes of an object or array to MaybeRef