...
|
...
|
@@ -124,6 +124,8 @@ export default { |
|
|
if (params.rootCommentId) {
|
|
|
this.page = get(result, 'data.page', 1);
|
|
|
this.prePage = this.page - 1;
|
|
|
} else {
|
|
|
this.prePage = 0;
|
|
|
}
|
|
|
|
|
|
this.totalPage = get(result, 'data.totalPage', 1);
|
...
|
...
|
@@ -173,8 +175,9 @@ export default { |
|
|
let scrollHeight = this.$refs.scroll.$el.offsetHeight;
|
|
|
let dom = this.$refs.commentList.getElementsByClassName('comment-' + this.commentId);
|
|
|
|
|
|
if (scrollHeight && dom.length && (dom[0].offsetHeight + dom[0].offsetoffsetTop > scrollHeight)) {
|
|
|
this.$refs.scroll.scrollTo(0, scrollHeight - this.$refs.commentList.offsetoffsetTop);
|
|
|
if (scrollHeight && dom.length && (dom[0].offsetHeight + dom[0].offsetTop > scrollHeight)) {
|
|
|
console.log(scrollHeight - this.$refs.commentList.offsetHeight)
|
|
|
this.$refs.scroll.scrollTo(0, scrollHeight - this.$refs.commentList.offsetHeight);
|
|
|
}
|
|
|
}, 500);
|
|
|
}
|
...
|
...
|
@@ -209,7 +212,7 @@ export default { |
|
|
onScrollEndHandle(e) {
|
|
|
this.scrollY = e.y;
|
|
|
|
|
|
if (this.prePage < 1) {
|
|
|
if (!this.commentId || this.prePage < 1) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
|