Yao 31e9bb83e8
[new feature] Actionsheet: 新增行动按钮组件 (#97)
* actionsheet init

* actionsheet process

* action sheet 功能补齐

* 增加 actionsheet readme

* 增加示例入口

* 增加标题配置
2018-01-01 16:41:30 +08:00

40 lines
1.3 KiB
Plaintext

<template name="zan-actionsheet">
<view class="zan-actionsheet {{ show ? 'zan-actionsheet--show' : '' }}">
<view
class="zan-actionsheet__mask"
catchtap="_handleZanActionsheetMaskClick"
data-close-on-click-overlay="{{ closeOnClickOverlay }}"
data-component-id="{{ componentId }}"></view>
<view class="zan-actionsheet__container">
<!-- 实际按钮显示 -->
<view
wx:for="{{ actions }}"
wx:for-index="index"
wx:for-item="item"
wx:key="{{ index }}-{{ item.name }}"
catchtap="_handleZanActionsheetBtnClick"
data-component-id="{{ componentId }}"
data-index="{{ index }}"
class="zan-btn zan-actionsheet__btn {{ item.loading ? 'zan-btn--loading' : '' }} {{ item.className }}"
>
<text>{{ item.name }}</text>
<text
wx:if="{{ item.subname }}"
class="zan-actionsheet__subname">{{ item.subname }}</text>
</view>
<!-- 关闭按钮 -->
<view
wx:if="{{ cancelText }}"
class="zan-actionsheet__footer"
>
<button
class="zan-btn zan-actionsheet__btn"
catchtap="_handleZanActionsheetCancelBtnClick"
data-component-id="{{ componentId }}"
>{{ cancelText }}</button>
</view>
</view>
</view>
</template>