Skip to content

Commit

Permalink
feat(components)!: affix offsetType props rename to position
Browse files Browse the repository at this point in the history
  • Loading branch information
chizukicn committed Nov 8, 2023
1 parent 0239943 commit db4fe8d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/affix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export const affixProps = defineHookProps(
type: Number,
default: 0
},

offsetType: {
/**
* @zh 固定的相对方向
*/
position: {
type: String as PropType<"top" | "bottom">,
default: "top"
},
Expand Down Expand Up @@ -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
? {
Expand Down

0 comments on commit db4fe8d

Please sign in to comment.