- 声明个data: active:0 和 timer:null (定时器)
- 五个内容各自绑定 v-show,比如第一个 v-show="active === 1"
- 然后,mounted生命周期中注册定时器,每各两秒active+1
this.timer = setTimeout(() => {
active===4?active=0:active++
}, 2000);
- beforedestory生命周期清楚定时器
clearTimeout(this.timer)
如有帮助,望采纳 ^.^ 谢谢啦~