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