From dc6bc7bcbddd871eb3dc8efaa2576b24eeecc001 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 29 Jun 2023 11:57:17 +0800 Subject: [PATCH] =?UTF-8?q?action=20sheet=20=E7=A4=BA=E4=BE=8B=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/action-sheet/action-sheet.uvue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/API/action-sheet/action-sheet.uvue b/pages/API/action-sheet/action-sheet.uvue index 74b48355..28f1e920 100644 --- a/pages/API/action-sheet/action-sheet.uvue +++ b/pages/API/action-sheet/action-sheet.uvue @@ -15,6 +15,10 @@ 自定义itemColor + + 超长列表文本 + + @@ -33,6 +37,7 @@ return { title: 'action-sheet', itemColorCustom:false, + itemContentLarge:false, items: [{ value: '标题', name: '有标题' @@ -70,16 +75,25 @@ } } }, + itemContentLargeChange: function (e : SwitchChangeEvent) { + this.itemContentLarge = e.detail.value + }, itemColorChange: function (e : SwitchChangeEvent) { this.itemColorCustom = e.detail.value }, actionSheetTap() { + let itemInfo = ['item1', 'item2', 'item3', 'item4'] + + if(this.itemContentLarge){ + itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', ''] + } + const that = this if(this.itemColorCustom){ uni.showActionSheet({ title: this.items[this.current].value, - itemList: ['item1', 'item2', 'item3', 'item4'], + itemList: itemInfo, itemColor:"#ff00ff", // #ifdef H5 popover: { @@ -99,7 +113,7 @@ }else{ uni.showActionSheet({ title: this.items[this.current].value, - itemList: ['item1', 'item2', 'item3', 'item4'], + itemList: itemInfo, // #ifdef H5 popover: { // 104: navbar + topwindow 高度,暂时 fix createSelectorQuery 在 pc 上获取 top 不准确的 bug -- GitLab