浏览器窗口的滚动条的位置 监听浏览器窗口的滚动条的位置,在vue中放在created中执行。 window.onscroll = function() { console.log(window.pageYOffset) } 基于vue写实时聊天室,让滚动条始终处于最底部的方法 this.$nextTick(()=>{ this.$refs.ulTxtBox.scrollTop = this.$refs.ulTxtBox.scrollHeight })