一、模态窗口
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15wx.showModal delete(){ wx.showModal({ title: '', content: '是否确认删除', success(res) { if (res.confirm) { console.log('用户点击确定') } else if (res.cancel) { console.log('用户点击取消') } } }) }
推荐一下我自己的前端学习群562862926,里面有大神总结的一套前端教学视频,欢迎有兴趣的朋友进群一起学习
二、提示你想提示的信息
提示你想提示的信息
复制代码
1
2
3
4
5
6wx.showToast({ title: '成功', icon: 'success', duration: 2000 })
注意
wx.showLoading 和 wx.showToast 同时只能显示一个
wx.showToast 应与 wx.hideToast 配对使用
三、显示 loading 提示框
复制代码
1
2
3
4
5
6
7
8wx.showLoading wx.showLoading({ title: '加载中', }) setTimeout(function () { wx.hideLoading() }, 2000)
四、 wx.showActionSheet(OBJECT)
复制代码
1
2
3
4
5
6
7
8
9
10wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function(res) { console.log(res.tapIndex) }, fail: function(res) { console.log(res.errMsg) } })
最后
以上就是疯狂豌豆最近收集整理的关于微信小程序之几种常见的弹框提示信息的全部内容,更多相关微信小程序之几种常见内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复