mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
feat(dropdown-menu): add safe-area-tab-bar prop support (#5257)
Co-authored-by: landluck <liuhaihong@youzan.com>
This commit is contained in:
parent
3a4baaff41
commit
77c765d451
@ -45,6 +45,7 @@ VantComponent({
|
|||||||
showPopup: false,
|
showPopup: false,
|
||||||
showWrapper: false,
|
showWrapper: false,
|
||||||
displayTitle: '',
|
displayTitle: '',
|
||||||
|
safeAreaTabBar: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -62,6 +63,7 @@ VantComponent({
|
|||||||
activeColor,
|
activeColor,
|
||||||
closeOnClickOverlay,
|
closeOnClickOverlay,
|
||||||
direction,
|
direction,
|
||||||
|
safeAreaTabBar,
|
||||||
} = this.parent.data;
|
} = this.parent.data;
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -70,6 +72,7 @@ VantComponent({
|
|||||||
activeColor,
|
activeColor,
|
||||||
closeOnClickOverlay,
|
closeOnClickOverlay,
|
||||||
direction,
|
direction,
|
||||||
|
safeAreaTabBar,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
overlay="{{ overlay }}"
|
overlay="{{ overlay }}"
|
||||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||||
duration="{{ transition ? duration : 0 }}"
|
duration="{{ transition ? duration : 0 }}"
|
||||||
|
safe-area-tab-bar="{{ safeAreaTabBar }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
rootPortal="{{ rootPortal }}"
|
rootPortal="{{ rootPortal }}"
|
||||||
bind:enter="onOpen"
|
bind:enter="onOpen"
|
||||||
|
@ -182,6 +182,7 @@ Page({
|
|||||||
| duration | 动画时长,单位毫秒 | _number_ | `200` |
|
| duration | 动画时长,单位毫秒 | _number_ | `200` |
|
||||||
| direction | 菜单展开方向,可选值为 up | _string_ | `down` |
|
| direction | 菜单展开方向,可选值为 up | _string_ | `down` |
|
||||||
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
||||||
|
| safe-area-tab-bar `v1.10.14`| 是否留出底部 tabbar 安全距离 | _boolean_ | `false` |
|
||||||
| close-on-click-overlay | 是否在点击遮罩层后关闭菜单 | _boolean_ | `true` |
|
| close-on-click-overlay | 是否在点击遮罩层后关闭菜单 | _boolean_ | `true` |
|
||||||
| close-on-click-outside | 是否在点击外部 menu 后关闭菜单 | _boolean_ | `true` |
|
| close-on-click-outside | 是否在点击外部 menu 后关闭菜单 | _boolean_ | `true` |
|
||||||
|
|
||||||
|
@ -36,6 +36,10 @@ VantComponent({
|
|||||||
value: 'down',
|
value: 'down',
|
||||||
observer: 'updateChildrenData',
|
observer: 'updateChildrenData',
|
||||||
},
|
},
|
||||||
|
safeAreaTabBar: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
closeOnClickOverlay: {
|
closeOnClickOverlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true,
|
value: true,
|
||||||
|
@ -101,7 +101,8 @@
|
|||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
&--bottom&--safeTabBar {
|
&--bottom&--safeTabBar,
|
||||||
|
&--top&--safeTabBar {
|
||||||
bottom: var(--tabbar-height, @tabbar-height);
|
bottom: var(--tabbar-height, @tabbar-height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user