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

补充load/action sheet 示例

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