mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-22 06:31:46 +08:00
[improvement] Popup: add z-index prop (#572)
This commit is contained in:
parent
83da58e030
commit
54d548a7b8
@ -51,6 +51,7 @@ Page({
|
||||
| position | 可选值为 `top` `bottom` `right` `left` | `String` | - |
|
||||
| overlay-style | 自定义蒙层样式 | `String` | `` |
|
||||
| close-on-click-overlay | 点击蒙层是否关闭 Popup | `Boolean` | `true` |
|
||||
| z-index | z-index 层级 | `Number` | `100` |
|
||||
| duration | 动画时长,单位为毫秒 | `Number` | `300` |
|
||||
|
||||
### Event
|
||||
|
@ -7,6 +7,10 @@ create({
|
||||
props: {
|
||||
transition: String,
|
||||
overlayStyle: String,
|
||||
zIndex: {
|
||||
type: Number,
|
||||
value: 100
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
|
@ -3,7 +3,6 @@
|
||||
.van-popup {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 11;
|
||||
position: fixed;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
|
@ -1,13 +1,14 @@
|
||||
<van-overlay
|
||||
mask
|
||||
show="{{ overlay && show }}"
|
||||
z-index="{{ zIndex }}"
|
||||
custom-style="{{ overlayStyle }}"
|
||||
bind:click="onClickOverlay"
|
||||
/>
|
||||
<view
|
||||
wx:if="{{ inited }}"
|
||||
class="custom-class van-popup {{ position ? 'van-popup--' + position : '' }}"
|
||||
style="animation-name: van-{{ transition || position }}-{{ type }}; animation-duration: {{ duration }}ms; {{ display ? '' : 'display: none;' }}"
|
||||
style="z-index: {{ zIndex }}; animation-name: van-{{ transition || position }}-{{ type }}; animation-duration: {{ duration }}ms; {{ display ? '' : 'display: none;' }}"
|
||||
bind:animationend="onAnimationEnd"
|
||||
>
|
||||
<slot />
|
||||
|
Loading…
x
Reference in New Issue
Block a user