//有时间限制,使用wx.hideToast()关闭,
//icon有3种,success(默认),loading,none,可以自定义img
wx.showToast({
title: '成功',
icon: 'success',
duration: 2000
})
//没有时间限制,使用wx.hideLoading()关闭
wx.showLoading({
title: '成功',
})
//showToast和showLoading只能同时使用一个,使用另一个就会关闭掉前一个。
官方文档:
https://developers.weixin.qq.com/miniprogram/dev/api/wx.showToast.html
https://developers.weixin.qq.com/miniprogram/dev/api/wx.showLoading.html