vue中聊天框不能定位在底部

 1  
 2 mounted () {
 3    this.scrollToBottom();
 4 },
 5  
 6  
 7 //每次页面渲染完之后滚动条在最底部
 8 updated(){
 9    this.scrollToBottom();
10 },
11  
12  
13  methods: {
14 // 
15      scrollToBottom() {
16      this.$nextTick(() => {
17         var container = this.$el.querySelector(" 需要滚动条处于底部的容器 ");
18         container.scrollTop = container.scrollHeight;
19      })}
20  
21 }

转载自:https://blog.csdn.net/qq_40190624/article/details/86424443

原文地址:https://www.cnblogs.com/liuChang888/p/14347262.html