mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
chore: rename composables folder
This commit is contained in:
14
src/composables/use-height.ts
Normal file
14
src/composables/use-height.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
};
|
Reference in New Issue
Block a user