mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-25 16:09:15 +08:00
actionsheet add opentype (#106)
This commit is contained in:
parent
7fc4176003
commit
ef1028837d
@ -17,10 +17,20 @@ Page(extend({}, Actionsheet, {
|
|||||||
subname: '选项描述语2',
|
subname: '选项描述语2',
|
||||||
className: 'action-class',
|
className: 'action-class',
|
||||||
loading: false
|
loading: false
|
||||||
|
}, {
|
||||||
|
name: '去分享',
|
||||||
|
openType: 'share'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onShareAppMessage() {
|
||||||
|
return {
|
||||||
|
title: 'ZanUI-WeApp',
|
||||||
|
imageUrl: 'https://img.yzcdn.cn/public_files/2017/02/06/ee0ebced79a80457d77ce71c7d414c74.png'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
toggleActionsheet() {
|
toggleActionsheet() {
|
||||||
this.setData({
|
this.setData({
|
||||||
'baseActionsheet.show': true
|
'baseActionsheet.show': true
|
||||||
@ -36,6 +46,11 @@ Page(extend({}, Actionsheet, {
|
|||||||
handleZanActionsheetClick({ componentId, index }) {
|
handleZanActionsheetClick({ componentId, index }) {
|
||||||
console.log(`item index ${index} clicked`);
|
console.log(`item index ${index} clicked`);
|
||||||
|
|
||||||
|
// 如果是分享按钮被点击, 不处理关闭
|
||||||
|
if (index === 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
[`${componentId}.actions[${index}].loading`]: true
|
[`${componentId}.actions[${index}].loading`]: true
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
data-component-id="{{ componentId }}"></view>
|
data-component-id="{{ componentId }}"></view>
|
||||||
<view class="zan-actionsheet__container">
|
<view class="zan-actionsheet__container">
|
||||||
<!-- 实际按钮显示 -->
|
<!-- 实际按钮显示 -->
|
||||||
<view
|
<button
|
||||||
wx:for="{{ actions }}"
|
wx:for="{{ actions }}"
|
||||||
wx:for-index="index"
|
wx:for-index="index"
|
||||||
wx:for-item="item"
|
wx:for-item="item"
|
||||||
@ -15,13 +15,14 @@
|
|||||||
catchtap="_handleZanActionsheetBtnClick"
|
catchtap="_handleZanActionsheetBtnClick"
|
||||||
data-component-id="{{ componentId }}"
|
data-component-id="{{ componentId }}"
|
||||||
data-index="{{ index }}"
|
data-index="{{ index }}"
|
||||||
|
open-type="{{ item.openType }}"
|
||||||
class="zan-btn zan-actionsheet__btn {{ item.loading ? 'zan-btn--loading' : '' }} {{ item.className }}"
|
class="zan-btn zan-actionsheet__btn {{ item.loading ? 'zan-btn--loading' : '' }} {{ item.className }}"
|
||||||
>
|
>
|
||||||
<text>{{ item.name }}</text>
|
<text>{{ item.name }}</text>
|
||||||
<text
|
<text
|
||||||
wx:if="{{ item.subname }}"
|
wx:if="{{ item.subname }}"
|
||||||
class="zan-actionsheet__subname">{{ item.subname }}</text>
|
class="zan-actionsheet__subname">{{ item.subname }}</text>
|
||||||
</view>
|
</button>
|
||||||
|
|
||||||
<!-- 关闭按钮 -->
|
<!-- 关闭按钮 -->
|
||||||
<view
|
<view
|
||||||
|
Loading…
x
Reference in New Issue
Block a user