我尝试使用滚动条滚动到HTML DIV元素的底部。
很不幸,我看到窗户在跳。
这是我滚动到底部的方式:
},
methods: {
scrollToEnd() {
const container = this.$refs.messagelog
container.scrollTop = container.scrollHeight
}
},
mounted() {
this.scrollToEnd()
},
我试图在beforeMount上运行代码,但是DOM不在此状态下加载。
有什么主意我该如何解决跳跃的错误?