mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 11:17:41 +00:00
15 lines
302 B
TypeScript
15 lines
302 B
TypeScript
import { useRect } from '@vant/use';
|
|
import { Ref, ref, onMounted, nextTick } from 'vue';
|
|
|
|
export const useHeight = (element: Element | Ref<Element>) => {
|
|
const height = ref();
|
|
|
|
onMounted(() => {
|
|
nextTick(() => {
|
|
height.value = useRect(element).height;
|
|
});
|
|
});
|
|
|
|
return height;
|
|
};
|