html模块
<span v-html="animation[count]"></span>
js模块
data数据
animation: ['网上购物 最高50倍保障', '已有267291人参加', '已获得保障金额57.29亿元'],
js函数模块
created () {
setTimeout(this.animations, 3000)
},
methods: {
animations () {
if (this.count >= 2) {
this.count = 0
} else {
this.count++
}
setTimeout(this.animations, 3000)
}
}