diff --git a/packages/vant/src/floating-panel/FloatingPanel.tsx b/packages/vant/src/floating-panel/FloatingPanel.tsx index 1d39faf3a..54a9c9fa8 100644 --- a/packages/vant/src/floating-panel/FloatingPanel.tsx +++ b/packages/vant/src/floating-panel/FloatingPanel.tsx @@ -16,7 +16,7 @@ import { } from '../utils'; // Composables -import { useWindowSize } from '@vant/use'; +import { useWindowSize, useEventListener } from '@vant/use'; import { useLockScroll } from '../composables/use-lock-scroll'; import { useTouch } from '../composables/use-touch'; import { useSyncPropRef } from '../composables/use-sync-prop-ref'; @@ -142,13 +142,15 @@ export default defineComponent({ useLockScroll(rootRef, () => true); + // useEventListener will set passive to `false` to eliminate the warning of Chrome + useEventListener('touchmove', onTouchmove, { target: rootRef }); + return () => (
Panel Show Height {{ height }} px
+Panel Show Height {{ height.toFixed(0) }} px
面板显示高度 {{ height }} px
+面板显示高度 {{ height.toFixed(0) }} px
{{ t('panelShowHeight') }} {{ height }} px
+{{ t('panelShowHeight') }} {{ height.toFixed(0) }} px