mounted() {    this.scrollToBottom();  },

  updated: function () {    this.scrollToBottom();  },

 scrollToBottom: function () {
          this.$nextTick(() => {
            var container = this.$el.querySelector("#chatBox-content-demo");
            container.scrollTop = container.scrollHeight;
          })
        }

必须在HTML上绑定 #chatBox-content-demo 这个id

Logo

前往低代码交流专区

更多推荐