[improvement]: Dialog:使Dialog中的Button支持open-type,并更新了相应的示例 (#247)

This commit is contained in:
Ethan Li 2018-05-21 21:11:09 +08:00 committed by Yao
parent f358a99b41
commit 208a3ee8e6
2 changed files with 17 additions and 1 deletions

View File

@ -32,6 +32,10 @@ Page({
text: '现金支付', text: '现金支付',
color: 'red', color: 'red',
type: 'cash' type: 'cash'
}, {
text: '分享',
type: 'share',
openType: 'share'
}, { }, {
text: '微信支付', text: '微信支付',
color: '#3CC51F', color: '#3CC51F',
@ -59,6 +63,10 @@ Page({
text: '微信支付', text: '微信支付',
color: '#3CC51F', color: '#3CC51F',
type: 'wechat' type: 'wechat'
}, {
text: '分享',
type: 'share',
openType: 'share'
}, { }, {
text: '取消', text: '取消',
type: 'cancel' type: 'cancel'
@ -66,5 +74,12 @@ Page({
}).then(({ type }) => { }).then(({ type }) => {
console.log('=== dialog with vertical buttons ===', `type: ${type}`); console.log('=== dialog with vertical buttons ===', `type: ${type}`);
}); });
} },
onShareAppMessage() {
return {
title: 'ZanUI-WeApp',
imageUrl: 'https://img.yzcdn.cn/public_files/2017/02/06/ee0ebced79a80457d77ce71c7d414c74.png'
};
},
}); });

View File

@ -23,6 +23,7 @@
class="zan-dialog__button" class="zan-dialog__button"
custom-class="{{ index === 0 ? 'zan-dialog__button-inside--first' : 'zan-dialog__button-inside' }}" custom-class="{{ index === 0 ? 'zan-dialog__button-inside--first' : 'zan-dialog__button-inside' }}"
data-type="{{ item.type }}" data-type="{{ item.type }}"
open-type="{{ item.openType }}"
bind:btnclick="handleButtonClick" bind:btnclick="handleButtonClick"
> >
<view <view