.vue mounted(){ this.scrollToBottom()
}, methods:{ scrollToBottom: function () { this.$nextTick(() => { var container = this.$el.querySelector('.chatContent');
container.scrollTop = container.scrollHeight;
})
}
}, updated:function () { this.scrollToBottom();
}就想讓div滾動條始終在底部,咋就這么難。。。補(bǔ)充:目前調(diào)試的是針對響應(yīng)式的時(shí)候,div高度拉長,滾動條居底部
添加回答
舉報(bào)
0/150
提交
取消