index.wxml 1.2 KB
<van-popup
  show="{{ show }}"
  position="bottom"
  z-index="{{ zIndex }}"
  overlay="{{ overlay }}"
  custom-class="van-action-sheet"
  close-on-click-overlay="{{ closeOnClickOverlay }}"
  bind:close="onClose"
>
  <view wx:if="{{ title }}" class="van-hairline--bottom van-action-sheet__header">
    {{ title }}
    <van-icon
      name="close"
      custom-class="van-action-sheet__close"
      bind:click="onClose"
    />
  </view>
  <button
    wx:for="{{ actions }}"
    wx:key="index"
    open-type="{{ item.openType }}"
    class="van-action-sheet__item van-hairline--top {{ item.disabled || item.loading ? 'van-action-sheet__item--disabled' : '' }} {{ item.className || '' }}"
    data-index="{{ index }}"
    bind:tap="onSelect"
  >
    <block wx:if="{{ !item.loading }}">
      {{ item.name }}
      <text wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</text>
    </block>
    <van-loading wx:else size="20px" />
  </button>
  <block wx:if="{{ cancelText }}">
    <view class="van-action-sheet__blank" />
    <view
      class="van-action-sheet__cancel"
      bind:tap="onCancel"
    >
      {{ cancelText }}
    </view>
  </block>
  <slot />
</van-popup>