mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
fix(CountDown): should clear timer when deactivated (#4919)
This commit is contained in:
@@ -44,6 +44,21 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
activated() {
|
||||
if (this.keepAlivePaused) {
|
||||
this.counting = true;
|
||||
this.keepAlivePaused = false;
|
||||
this.tick();
|
||||
}
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
if (this.counting) {
|
||||
this.pause();
|
||||
this.keepAlivePaused = true;
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.pause();
|
||||
},
|
||||
|
Reference in New Issue
Block a user