From 8d6894ef4e3273dcf0c0946cd773a53991b9425b Mon Sep 17 00:00:00 2001 From: duqingquan Date: Sat, 1 Jul 2023 15:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85load/action=20sheet=20?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/action-sheet/action-sheet.uvue | 19 ++++++++++++++++++- pages/API/show-loading/show-loading.uvue | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pages/API/action-sheet/action-sheet.uvue b/pages/API/action-sheet/action-sheet.uvue index bfb86b8c..2c86c7ae 100644 --- a/pages/API/action-sheet/action-sheet.uvue +++ b/pages/API/action-sheet/action-sheet.uvue @@ -19,6 +19,10 @@ 超长列表文本 + + 大量选项 + + @@ -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({ diff --git a/pages/API/show-loading/show-loading.uvue b/pages/API/show-loading/show-loading.uvue index a9aa706d..645b1aa6 100644 --- a/pages/API/show-loading/show-loading.uvue +++ b/pages/API/show-loading/show-loading.uvue @@ -3,7 +3,7 @@ - 是否显示透明蒙层 + 是否显示透明蒙层-屏蔽点击事件 @@ -69,6 +69,7 @@ // #ifdef MP-ALIPAY , onUnload() { + // 页面卸载的时候,手动关闭loading this._showTimer && clearTimeout(this._showTimer); } // #endif -- GitLab