From db4fe8d20bc98f765b3a36ab773c1eb889ece699 Mon Sep 17 00:00:00 2001 From: chizukicn Date: Wed, 8 Nov 2023 14:57:08 +0800 Subject: [PATCH] feat(components)!: affix `offsetType` props rename to `position` --- packages/core/src/affix/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/src/affix/index.ts b/packages/core/src/affix/index.ts index 2438397..f207d0b 100644 --- a/packages/core/src/affix/index.ts +++ b/packages/core/src/affix/index.ts @@ -18,8 +18,10 @@ export const affixProps = defineHookProps( type: Number, default: 0 }, - - offsetType: { + /** + * @zh 固定的相对方向 + */ + position: { type: String as PropType<"top" | "bottom">, default: "top" }, @@ -100,7 +102,7 @@ export const useAffix = defineHookComponent({ const offset = props.offset; - if (props.offsetType === "top") { + if (props.position === "top") { newIsFixed = (wrapperRect.top - targetRect.top < offset) && offset >= 0; newFixedStyles = newIsFixed ? {