this.$nextTick(() => {
this.ulDom = this.$refs.ul//高度不固定的子级元素,高度大于父级
this.divDom = this.$refs.scrollcon//固定高度的父级元素
})
this.$nextTick(()=>{
console.log(this.ulDom.offsetHeight)
this.divDom.scrollTop = this.ulDom.offsetHeight
})
vue js滚动到顶部底部
猜你喜欢
转载自blog.csdn.net/weixin_41254345/article/details/104481762
今日推荐
周排行