code does not report an error, and the browser crashes after running for a period of time. The specific code is as follows:
carousel () {
let self = this;
if(!window.timer){
this.carouselText = "";
let oLen = this.substationTree.length;
window.timer = setInterval(() => {
self.carouselIndex = self.carouselIndex < oLen - 1 ? self.carouselIndex + 1 : 0;
self.$set(self.substationTree[self.carouselIndex], "selected", true);
self.selectedNode = Object.assign({}, self.substationTree[self.carouselIndex]);
self.clickOnTreeNode([self.substationTree[self.carouselIndex]]);
}, 5000);
}else {
this.carouselText = "";
window.clearInterval(window.timer);
window.timer = undefined;
}
}