vant-weapp/dist/toast/index.js
2016-12-20 11:23:39 +08:00

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
});
}
};