FWQ
微信小程序组件:toast显示消息提示框解读和分析
toast显示消息提提示框组件说明: Toast是当用户点击某些组件时弹出来来的提示消息。Toast会帮助你创建和显示这些消息。Toast是一种简易的消息提示框。当视图显示给用户,在应用程序中显示为浮动。小程序即将废弃Toast组件,故这里介绍Toast的API:wx.showToast toast显示消息提示框组件的示例代码运行效果如下: 下面是WXML代码: <!--index.下面是WXML代码:--> <view> <text>Toast功能</text> <view> <button>展示Toast</button> <button>隐藏Toast</button> </view></view> 登录后复制 下面是JS代码: Page({ showToast:function(){ var that=this; wx.showToast({ title: '成功', icon: 'success', duration: 2000, success: that.flySuccess, fail:that.flyFail, complete:that.flyComplete }) }, hideToast:function(){…