unction showToast(title, type = 'error') {
let image = '';
switch (type) {
case 'error':
image = '/images/icon_error.png'
break;
case 'success':
image = '/images/icon_success.png'
break;
case 'warning':
image = '/images/icon_warning.png'
break;
}
wx.showToast({
title: title,
image: image,
duration: 0,
mask: true,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}
小程序toast封装
最新推荐文章于 2024-07-12 16:56:43 发布