刚进入页面时,使得页面滑动到盒子底部
<div class="swapper" ref="scroll">
<div class="item" v-for="(item, index) in signInList" :key="index" @click="toPage">
<img class="avatar" :src="item.avatar" alt="头像" />
<div class="name">{{item.name}}</div>
</div>
</div>
</div>
mounted(){
this.$nextTick(() => {
this.scrollBottom()
})
},
scrollBottom () {
var div = this.$refs.scroll
div.scrollTop = div.scrollHeight
},
.swapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
height: 590*$w;
overflow-y: auto;
margin: 40*$w 0 0 120*$w;
&::-webkit-scrollbar{
width: 10*$w;
background: #f6f7f7;
margin-left: 2*$w;
border-radius: 0 8*$w 8*$w 0*$w;
}
&::-webkit-scrollbar-thumb{
width: 10*$w;
background: #C3C3C3;
border-radius: 5*$w;
}
&::-webkit-scrollbar-button {
display: none;
}