[Vuejs]-How to destroy all the data of the current page

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.

Leave a comment