做個了需求是點擊右側的item 左邊滾動到隊員的位置。。請問怎么可以在滾的時候加一些過度效果。。下面是我的代碼scrollToEl(name){ let scrollPosition=0 this.playerlist.forEach((item,index)=>{ if(item.players_name==name){ scrollPosition=index } }) // this.$refs.index[scrollPosition].scrollIntoView() let jump=document.querySelectorAll('.pick-right-item') let total=jump[scrollPosition].offsetTop console.log(total); // Chrome document.body.scrollTop = total }這樣可以直接滾動到制定位置,但是在vue中怎么做scroll的滾動動畫。。
Vue 怎么做scrolltop 的滾動動畫
喵喵時光機
2018-12-13 14:15:04