刚进入页面时,使得页面滑动到盒子底部
<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