We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4a8100 commit 1b081b2Copy full SHA for 1b081b2
src/mixins/using-custom-navbar.ts
@@ -4,6 +4,10 @@ const useCustomNavbarBehavior = Behavior({
4
type: Boolean,
5
value: false,
6
},
7
+ customNavbarHeight: {
8
+ type: Number,
9
+ value: 0,
10
+ },
11
12
data: {
13
distanceTop: 0,
@@ -21,10 +25,10 @@ const useCustomNavbarBehavior = Behavior({
21
25
calculateCustomNavbarDistanceTop() {
22
26
const { statusBarHeight } = wx.getSystemInfoSync();
23
27
const menuButton = wx.getMenuButtonBoundingClientRect();
24
- const distanceTop = menuButton.top + menuButton.bottom - statusBarHeight;
28
+ const distance = menuButton.top + menuButton.bottom - statusBarHeight;
29
30
this.setData({
- distanceTop,
31
+ distanceTop: Math.max(distance, this.properties.customNavbarHeight),
32
});
33
34
0 commit comments