1.计算向上卷曲的高度,再设置向上卷曲的高度
const { scrollHeight } = this.$refs.chatWindowRef
this.$refs.chatWindowRef.scrollTo(0, scrollHeight)
2.使用scrollToView方法
const element = document.getElementById("id")
// 使用scrolltoView滚动至目标dom
element.scrollIntoView({behavior: "smooth", inline: "nearest"})