diff --git a/packages/vant/src/composables/use-height.ts b/packages/vant/src/composables/use-height.ts index 487f521de..dec59831d 100644 --- a/packages/vant/src/composables/use-height.ts +++ b/packages/vant/src/composables/use-height.ts @@ -4,11 +4,15 @@ import { Ref, ref, onMounted, nextTick } from 'vue'; export const useHeight = (element: Element | Ref) => { const height = ref(); - onMounted(() => + onMounted(() => { nextTick(() => { height.value = useRect(element).height; - }) - ); + }); + // https://github.com/youzan/vant/issues/10131 + setTimeout(() => { + height.value = useRect(element).height; + }, 100); + }); return height; };