From a762b59c2c4b459f72ede19716d476bb3513f622 Mon Sep 17 00:00:00 2001 From: gerson <1405270578@qq.com> Date: 星期四, 20 二月 2025 08:27:57 +0800 Subject: [PATCH] 获取位置 --- src/utils/types.ts | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/utils/types.ts b/src/utils/types.ts index c041822..ffbf5b9 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -1,4 +1,5 @@ import { isNil } from 'lodash-unified'; +import { ref } from 'vue'; export const isUndefined = (val: any): val is undefined => val === undefined; export const isBoolean = (val: any): val is boolean => typeof val === 'boolean'; @@ -9,3 +10,10 @@ }; export const isFilledArray = (val: any) => Array.isArray(val) && val.length > 0; +/** + * + * @param _comp 缁勪欢鏋勯�犲嚱鏁� + * @returns 缁勪欢 ref + * @example const formRef = useCompRef(ElForm); + */ +export const useCompRef = <T extends abstract new (...args: any) => any>(_comp: T) => ref<InstanceType<T>>(); \ No newline at end of file -- Gitblit v1.9.3