Yao b8930d972a
[refactor] Dialog: 升级为自定义组件 (#184)
* 封装 doc-page, 方便写文档

* add pop manager

* popup upgrade

* 更新 README

* add empty line

* delete empty css

* dialog init

* dialog

* dialog upgrade

* 修复 helper 里的样式问题

* dialog 文档

* 修复 button 奇怪的边框问题

* 缩进处理
2018-04-07 22:28:23 +08:00

37 lines
1.0 KiB
Plaintext

<pop-manager
show="{{ show }}"
type="center"
overlay="{{ true }}"
>
<view class="zan-dialog--container">
<view
wx:if="{{ title }}"
class="zan-dialog__header"
>{{ title }}</view>
<view
class="zan-dialog__content {{ title ? 'zan-dialog__content--title' : '' }}"
>
<text>{{ message }}</text>
</view>
<view
class="zan-dialog__footer {{ buttonsShowVertical ? 'zan-dialog__footer--vertical' : 'zan-dialog__footer--horizon' }}"
>
<block
wx:for="{{ buttons }}"
wx:key="{{ item.text }}-{{ item.type }}"
>
<zan-button
class="zan-dialog__button"
custom-class="{{ index === 0 ? 'zan-dialog__button-inside--first' : 'zan-dialog__button-inside' }}"
data-type="{{ item.type }}"
bind:btnclick="handleButtonClick"
>
<view
style="color: {{ item.color || '#333' }}"
>{{ item.text }}</view>
</zan-button>
</block>
</view>
</view>
</pop-manager>