Skip to content

Commit 1b081b2

Browse files
committed
chore: add customNavbarHeight props for useCustomNavbarBehavior
1 parent c4a8100 commit 1b081b2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/mixins/using-custom-navbar.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const useCustomNavbarBehavior = Behavior({
44
type: Boolean,
55
value: false,
66
},
7+
customNavbarHeight: {
8+
type: Number,
9+
value: 0,
10+
},
711
},
812
data: {
913
distanceTop: 0,
@@ -21,10 +25,10 @@ const useCustomNavbarBehavior = Behavior({
2125
calculateCustomNavbarDistanceTop() {
2226
const { statusBarHeight } = wx.getSystemInfoSync();
2327
const menuButton = wx.getMenuButtonBoundingClientRect();
24-
const distanceTop = menuButton.top + menuButton.bottom - statusBarHeight;
28+
const distance = menuButton.top + menuButton.bottom - statusBarHeight;
2529

2630
this.setData({
27-
distanceTop,
31+
distanceTop: Math.max(distance, this.properties.customNavbarHeight),
2832
});
2933
},
3034
},

0 commit comments

Comments
 (0)