提交 | 用户 | age
|
d98d05
|
1 |
<wxs src="../wxs/utils.wxs" module="utils" /> |
S |
2 |
|
|
3 |
<view |
|
4 |
wx:if="{{ showWrapper }}" |
|
5 |
class="{{ utils.bem('dropdown-item', direction) }}" |
|
6 |
style="{{ wrapperStyle }}" |
|
7 |
> |
|
8 |
<van-popup |
|
9 |
show="{{ showPopup }}" |
|
10 |
custom-style="position: absolute;{{ popupStyle }}" |
|
11 |
overlay-style="position: absolute;" |
|
12 |
overlay="{{ overlay }}" |
|
13 |
position="{{ direction === 'down' ? 'top' : 'bottom' }}" |
|
14 |
duration="{{ transition ? duration : 0 }}" |
|
15 |
close-on-click-overlay="{{ closeOnClickOverlay }}" |
|
16 |
bind:enter="onOpen" |
|
17 |
bind:leave="onClose" |
|
18 |
bind:close="toggle" |
|
19 |
bind:after-enter="onOpened" |
|
20 |
bind:after-leave="onClosed" |
|
21 |
> |
|
22 |
<van-cell |
|
23 |
wx:for="{{ options }}" |
|
24 |
wx:key="value" |
|
25 |
data-option="{{ item }}" |
|
26 |
class="{{ utils.bem('dropdown-item__option', { active: item.value === value } ) }}" |
|
27 |
clickable |
|
28 |
icon="{{ item.icon }}" |
|
29 |
bind:tap="onOptionTap" |
|
30 |
> |
|
31 |
<view |
|
32 |
slot="title" |
|
33 |
class="van-dropdown-item__title" |
|
34 |
style="{{ item.value === value ? 'color:' + activeColor : '' }}" |
|
35 |
> |
|
36 |
{{ item.text }} |
|
37 |
</view> |
|
38 |
<van-icon |
|
39 |
wx:if="{{ item.value === value }}" |
|
40 |
name="success" |
|
41 |
class="van-dropdown-item__icon" |
|
42 |
color="{{ activeColor }}" |
|
43 |
/> |
|
44 |
</van-cell> |
|
45 |
|
|
46 |
<slot /> |
|
47 |
</van-popup> |
|
48 |
</view> |