vue 滚动条到最底部


private scrollToBottom() { this.$nextTick(() => { const container = this.$el.querySelector(".chatDialog-wrap"); // @ts-ignore container.scrollTop = container.scrollHeight; }); }

  

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

private updated() {
    this.scrollToBottom();
}

  

上一篇:vue中的nextTick


下一篇:杂记 -- 关于ref、kepp-alive、nextTick