You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
621 B
26 lines
621 B
// eslint-disable-next-line no-undef
|
|
export default Behavior({
|
|
observers: {
|
|
'show': function (show) {
|
|
show && this.changeStatus();
|
|
if (!show) this.setData({
|
|
status: show
|
|
});
|
|
}
|
|
},
|
|
methods: {
|
|
changeStatus() {
|
|
this.setData({
|
|
status: true
|
|
});
|
|
if (this.data.timer) clearTimeout(this.data.timer);
|
|
this.data.timer = setTimeout(() => {
|
|
this.setData({
|
|
status: false
|
|
});
|
|
if (this.data.success) this.data.success();
|
|
this.data.timer = null;
|
|
}, this.properties.duration);
|
|
}
|
|
}
|
|
}); |