mounted () {
this.scrollToBottom();
},
//每次页面渲染完之后滚动条在最底部
updated:function(){
this.scrollToBottom();
},
methods:{
scrollToBottom: function () {
this.$nextTick(() => {
var container = this.$el.querySelector(".chatBox-content-demo");
container.scrollTop = container.scrollHeight;
})
}
}