提交 8d6894ef 编写于 作者: 杜庆泉's avatar 杜庆泉

补充load/action sheet 示例

上级 ea2512d7
......@@ -19,6 +19,10 @@
<view class="uni-list-cell-db">超长列表文本</view>
<switch :checked="itemContentLarge" @change="itemContentLargeChange"/>
</view>
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">大量选项</view>
<switch :checked="itemNumLargeSelect" @change="itemNumLargeChange"/>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
......@@ -38,6 +42,7 @@
title: 'action-sheet',
itemColorCustom:false,
itemContentLarge:false,
itemNumLargeSelect:false,
items: [{
value: '标题',
name: '有标题'
......@@ -81,12 +86,21 @@
itemColorChange: function (e : SwitchChangeEvent) {
this.itemColorCustom = e.detail.value
},
itemNumLargeChange: function (e : SwitchChangeEvent) {
this.itemNumLargeSelect = e.detail.value
},
actionSheetTap() {
let itemInfo = ['item1', 'item2', 'item3', 'item4']
if(this.itemContentLarge){
itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', '']
}else if(this.itemNumLargeSelect){
// 大量选项测试,不能超过6个元素 https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet
itemInfo = []
for (var i = 1; i <= 10; i++) {
itemInfo.push('两个黄鹂鸣翠柳,一行白鹭上青天');
}
}
const that = this
......@@ -108,7 +122,10 @@
title: "点击了第" + e.tapIndex + "个选项",
icon: "none"
})
}
},
fail: (e) => {
console.log(e);
}
})
}else{
uni.showActionSheet({
......
......@@ -3,7 +3,7 @@
<page-head :title="title"></page-head>
<view class="uni-list">
<view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否显示透明蒙层</view>
<view class="uni-list-cell-db">是否显示透明蒙层-屏蔽点击事件</view>
<switch :checked="maskSelect" @change="maskChange"/>
</view>
<view class="uni-list-cell uni-list-cell-pd">
......@@ -69,6 +69,7 @@
// #ifdef MP-ALIPAY
,
onUnload() {
// 页面卸载的时候,手动关闭loading
this._showTimer && clearTimeout(this._showTimer);
}
// #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册