添加watch方法,监听数据变量的变化,动态添加滚动条,
watch: { chatlog() { this.$nextTick(() => { var container = this.$el.querySelector("#chatContainer"); container.scrollTop = container.scrollHeight; }) }}