0👍
It’s strange, try to set debugger;
before clearInterval to check variables.
By the way not all codepaths ok (looks like initializations doubled).
You should rewrite as
if (this.myInterval !== null) {
clearInterval(this.myInterval);
this.myInterval = null;
}
and add corresponding guard at setInt:
setInt() {
if (this.myInterval === null ) {
this.myInterval = setInterval(function() { .... } , 3000);
}
}
May you need one interval per graph, please check your logic.
- [Vuejs]-How to manage authentication of a user through a vue router and a server-provided JWT token?
- [Vuejs]-Containers are not inline in my Vue Swiper
Source:stackexchange.com