import { unref } from 'vue'; import { MaybeRef } from './../constants/types'; /** * 直接获取 ref 的值,支持传入ref对象,key */ export function useGetRefValue(ref: MaybeRef): T; export function useGetRefValue(ref: MaybeRef, key: K): T[K]; export function useGetRefValue(obj: MaybeRef, key?: string | number | symbol) { return key ? unref(obj)[key] : unref(obj); }