automated_uniapp/cool/hooks/comm.ts

12 lines
228 B
TypeScript
Raw Normal View History

2025-01-09 16:16:11 +08:00
import { reactive } from "vue";
export function useRefs() {
const refs = reactive<{ [key: string]: any }>({});
function setRefs(name: string) {
return (el: any) => {
refs[name] = el;
};
}
return { refs, setRefs };
}