From 0acb2f2360b359615dca17f8266cbf0c5e3f15a5 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 4 Dec 2023 11:22:19 +0800 Subject: [PATCH] =?UTF-8?q?prompt=20=E5=A2=9E=E5=8A=A0=20onload=20?= =?UTF-8?q?=E8=B0=83=E7=94=A8=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 | 10 ++++++++-- pages/API/loading/loading.uvue | 8 ++++++++ pages/API/modal/modal.uvue | 6 ++++++ pages/API/toast/toast.uvue | 8 ++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/pages/API/action-sheet/action-sheet.uvue b/pages/API/action-sheet/action-sheet.uvue index a16c30bd..a9989520 100644 --- a/pages/API/action-sheet/action-sheet.uvue +++ b/pages/API/action-sheet/action-sheet.uvue @@ -57,6 +57,12 @@ ] as ItemType[], current: 0, } + }, + onLoad(){ + uni.showActionSheet({ + title: "onLoad 调用示例,请手动取消", + itemList:['item1', 'item2'], + }) }, methods: { radioChange(e : RadioGroupChangeEvent) { @@ -82,8 +88,8 @@ if (this.itemContentLarge) { itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', ''] - } - + } + if (this.itemNumLargeSelect) { // 大量选项测试,不能超过6个元素 https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet itemInfo = [] diff --git a/pages/API/loading/loading.uvue b/pages/API/loading/loading.uvue index 5669460e..7230fe74 100644 --- a/pages/API/loading/loading.uvue +++ b/pages/API/loading/loading.uvue @@ -58,6 +58,14 @@ titleSelect: "null" } }, + onLoad(){ + uni.showLoading({ + title:'onLoad 调用示例,1秒后消失' + }) + setTimeout(function() { + uni.hideLoading() + }, 1000); + }, methods: { radioChange(e : RadioGroupChangeEvent) { diff --git a/pages/API/modal/modal.uvue b/pages/API/modal/modal.uvue index 587786ae..e9fad323 100644 --- a/pages/API/modal/modal.uvue +++ b/pages/API/modal/modal.uvue @@ -79,6 +79,12 @@ current: 0 } }, + onLoad(){ + uni.showModal({ + title: "onLoad 调用示例,请手动取消", + showCancel:false + }) + }, methods: { showCancelChange: function (e : SwitchChangeEvent) { this.showCancelSelect = e.detail.value diff --git a/pages/API/toast/toast.uvue b/pages/API/toast/toast.uvue index bb3c5add..5c126699 100644 --- a/pages/API/toast/toast.uvue +++ b/pages/API/toast/toast.uvue @@ -27,6 +27,14 @@ exeRet: '' } }, + onLoad(){ + uni.showToast({ + title:'onLoad 调用示例,1秒后消失' + }) + setTimeout(function() { + uni.hideToast() + }, 1000); + }, methods: { toast1Tap: function () { uni.showToast({ -- GitLab