mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
29 lines
512 B
JavaScript
29 lines
512 B
JavaScript
module.exports = {
|
|
showZuiToast(title, timeout) {
|
|
var zuiToast = this.data.zuiToast || {};
|
|
clearTimeout(zuiToast.timer);
|
|
|
|
// 弹层设置~
|
|
zuiToast = {
|
|
show: true,
|
|
title
|
|
};
|
|
this.setData({
|
|
zuiToast
|
|
});
|
|
|
|
zuiToast.timer = setTimeout(() => {
|
|
this.clearZuiToast();
|
|
}, timeout || 3000);
|
|
},
|
|
|
|
clearZuiToast() {
|
|
var zuiToast = this.data.zuiToast || {};
|
|
clearTimeout(zuiToast.timer);
|
|
|
|
this.setData({
|
|
'zuiToast.show': false
|
|
});
|
|
}
|
|
};
|