Yao 451a3b19fc
[new feature] 增加 css 编译,方便组件书写 (#40)
* add src dir && add build

* add build watch && change dir name

* bower ignore package.json
2017-10-29 10:42:28 +08:00

33 lines
565 B
JavaScript

module.exports = {
showZanToast(title, timeout) {
var zanToast = this.data.zanToast || {};
clearTimeout(zanToast.timer);
// 弹层设置~
zanToast = {
show: true,
title
};
this.setData({
zanToast
});
var timer = setTimeout(() => {
this.clearZanToast();
}, timeout || 3000);
this.setData({
'zanToast.timer': timer
});
},
clearZanToast() {
var zanToast = this.data.zanToast || {};
clearTimeout(zanToast.timer);
this.setData({
'zanToast.show': false
});
}
};