diff --git a/packages/vant/src/floating-panel/FloatingPanel.tsx b/packages/vant/src/floating-panel/FloatingPanel.tsx index 54a9c9fa8..b4d9b2002 100644 --- a/packages/vant/src/floating-panel/FloatingPanel.tsx +++ b/packages/vant/src/floating-panel/FloatingPanel.tsx @@ -9,6 +9,7 @@ import { // Utils import { addUnit, + closest, createNamespace, makeArrayProp, makeNumericProp, @@ -88,11 +89,6 @@ export default defineComponent({ return moveY; }; - const closest = (arr: number[], target: number) => - arr.reduce((pre, cur) => - Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur - ); - let startY: number; const touch = useTouch();