vue保持滚动条在底部
2024-09-08 14:24:02
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
最新文章
- Android Fragment使用(二) 嵌套Fragments (Nested Fragments) 的使用及常见错误
- C++的简单“五子棋”游戏,只是核心代码,资源代码未添加
- socket 网络编程
- [CareerCup] 8.8 Othello Game 黑白棋游戏
- win10 enterprise 10240激活:
- 【贪心】 BZOJ 3252:攻略
- js中对闭包的理解
- iOS,长按图片保存实现方法,轻松搞定!
- (转)JS页面间传值
- UITableView显示不全
- android-包签名
- 安装webstrom,免激活长久使用
- python flask(多对多表查询)
- ConcurrenHashMap源码分析(二)
- SQLiteOpenHelper与SQLiteDatabase的使用
- vue路由懒加载 及import
- Ubuntu16系统中安装htpasswd
- hdu 2098 分拆素数和(素数)
- cpu load过高问题排查
- 开发人员如何正确对待BUG?