mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-25 02:58:27 +08:00
[bugfix] ActionSheet:修复actions动态变化时,渲染后button被打散的问题 (#1070)
This commit is contained in:
parent
721cd6d6ad
commit
7a84f7b1bc
@ -16,20 +16,23 @@
|
|||||||
bind:click="onClose"
|
bind:click="onClose"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<button
|
<view wx:if="{{ actions && actions.length }}">
|
||||||
wx:for="{{ actions }}"
|
<!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
|
||||||
wx:key="index"
|
<button
|
||||||
open-type="{{ item.openType }}"
|
wx:for="{{ actions }}"
|
||||||
class="van-action-sheet__item van-hairline--top {{ item.disabled || item.loading ? 'van-action-sheet__item--disabled' : '' }} {{ item.className || '' }}"
|
wx:key="index"
|
||||||
data-index="{{ index }}"
|
open-type="{{ item.openType }}"
|
||||||
bind:tap="onSelect"
|
class="van-action-sheet__item van-hairline--top {{ item.disabled || item.loading ? 'van-action-sheet__item--disabled' : '' }} {{ item.className || '' }}"
|
||||||
>
|
data-index="{{ index }}"
|
||||||
<block wx:if="{{ !item.loading }}">
|
bind:tap="onSelect"
|
||||||
{{ item.name }}
|
>
|
||||||
<text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
|
<block wx:if="{{ !item.loading }}">
|
||||||
</block>
|
{{ item.name }}
|
||||||
<van-loading wx:else size="20px" />
|
<text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
|
||||||
</button>
|
</block>
|
||||||
|
<van-loading wx:else size="20px" />
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
<view
|
<view
|
||||||
wx:if="{{ cancelText }}"
|
wx:if="{{ cancelText }}"
|
||||||
class="van-action-sheet__cancel"
|
class="van-action-sheet__cancel"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user