autoLoop () { // 無縫滾動方法
this.right.animateUp = true // 定義的一個變量,用來判斷現在是否要添加amit類
setTimeout(() => {
this.right.orgAmount.push(this.right.orgAmount[0])
this.right.orgAmount.shift()
this.right.animateUp = false
}, 500)
},
// css中
.anim {
transition: all 0.5s;
margin-top: -32px;
}
// html 父元素上
<div :class="right.animateUp: 'amit' : ''"></div>