Скажите, пожалуйста, что я делаю не так?Я хочу, чтобы активная «ткань» обновлялась каждые 2 сек.Все еще учусь вю.Спасибо
data() {
return {
clothes: ['t-shirts', 'sneakers', 'jackets'],
count: 0,
cloth: ''
}
},
methods: {
startInterval() {
setInterval(() => {
this.cloth = this.clothes[this.count]
this.count++
if (this.count >= this.clothes.length) {
this.count = 0;
}
}, 2000)
}
}