From 28b26e102378f409d65078e66f91c906955ba563 Mon Sep 17 00:00:00 2001 From: sunlu Date: Wed, 25 Sep 2024 20:06:59 +0800 Subject: [PATCH] Update FloatingBubble.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit offset 为负数时,边距按right、bottom计算 --- packages/vant/src/floating-bubble/FloatingBubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vant/src/floating-bubble/FloatingBubble.tsx b/packages/vant/src/floating-bubble/FloatingBubble.tsx index 52e859c86d0..4d10c7c0b9e 100644 --- a/packages/vant/src/floating-bubble/FloatingBubble.tsx +++ b/packages/vant/src/floating-bubble/FloatingBubble.tsx @@ -110,8 +110,8 @@ export default defineComponent({ const { width, height } = useRect(rootRef.value!); const { offset } = props; state.value = { - x: offset.x > -1 ? offset.x : windowWidth.value - width - props.gap, - y: offset.y > -1 ? offset.y : windowHeight.value - height - props.gap, + x: offset.x > -1 ? offset.x : windowWidth.value - width - props.gap + offset.x, + y: offset.y > -1 ? offset.y : windowHeight.value - height - props.gap + offset.y, width, height, };