index自动累加,超过list长度index则归零
getactive() {
if (this.active < this.list.length - 1) {
this.active = this.active + 1
} else {
this.active = 0
}
},
getswich() {
clearInterval(this.time);
let that = this;
this.time = window.setInterval(() => {
setTimeout(() => {
that.getactive();
}, 0)
}, 30000)
},