mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 13:39:40 +08:00
10 lines
248 B
TypeScript
10 lines
248 B
TypeScript
import { unref } from 'vue';
|
|
import type { MaybeComputedRef } from './types';
|
|
|
|
/**
|
|
* Get the value of value/ref/getter.
|
|
*/
|
|
export function resolveUnref<T>(r: MaybeComputedRef<T>): T {
|
|
return typeof r === 'function' ? (r as any)() : unref(r);
|
|
}
|