mounted(){
this.$refs.chatMain.scrollTop = this.$refs.chatMain.scrollHeight
// 监听window的resize事件
window.onresize = () => {
this.$refs.chatMain.scrollTop = this.$refs.chatMain.scrollHeight
}
}
Vue 让一个东西永远处于最底部
最新推荐文章于 2023-11-21 10:28:00 发布