提交 42458fe4 编写于 作者: 杜庆泉's avatar 杜庆泉

toast 示例增加 系统弹窗 top/center 的示例

上级 a1aafef0
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
<!-- #ifndef MP-ALIPAY --> <!-- #ifndef MP-ALIPAY -->
<button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button> <button class="uni-btn-v" type="default" @tap="toast4Tap">点击弹出显示自定义图片的toast</button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<button class="uni-btn-v" type="default" @tap="toast5TapTop">点击显示无图标的居顶toast</button>
<button class="uni-btn-v" type="default" @tap="toast5TapCenter">点击显示无图标的居中toast</button>
<button class="uni-btn-v" type="default" @tap="toast5Tap">点击显示无图标的居底toast</button> <button class="uni-btn-v" type="default" @tap="toast5Tap">点击显示无图标的居底toast</button>
<!-- #endif --> <!-- #endif -->
<button class="uni-btn-v" type="default" @tap="hideToast">点击隐藏toast</button> <button class="uni-btn-v" type="default" @tap="hideToast">点击隐藏toast</button>
...@@ -88,7 +90,31 @@ ...@@ -88,7 +90,31 @@
}, },
}) })
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
toast5TapTop: function () {
uni.showToast({
title: "显示一段轻提示",
position: 'top',
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast5TapCenter: function () {
uni.showToast({
title: "显示一段轻提示",
position: 'center',
success: function (res) {
this.exeRet = "success:" + JSON.stringify(res) + new Date()
},
fail: function (res) {
this.exeRet = "fail:" + JSON.stringify(res)
},
})
},
toast5Tap: function () { toast5Tap: function () {
uni.showToast({ uni.showToast({
title: "显示一段轻提示", title: "显示一段轻提示",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册