WeChat Mini Programs's setInterval can't be turned off.

question:
1. Create a timer in the custom function: this.data.inval = setInterval ();
2. Clear clearInterval (this.data.inval) in the bindchange event of swiper; it is found that it cannot be cleared.

is there any situation in which the timer can not be cleared? ask for advice


Why are timers in data? just define a timer variable on the outside.

Menu