Commit 4b003911 by huaying

fix: 分组滚动加载数据

parent 6e9ea573
......@@ -70,7 +70,8 @@ export default {
pageNum: 1,
totalPage: 1
},
loading: false
loading: false,
loadings: false,
};
},
directives: {
......@@ -79,7 +80,7 @@ export default {
const SELECTDOWN_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
SELECTDOWN_DOM.addEventListener('scroll', function() {
const CONDITION = this.scrollHeight - this.scrollTop -100 <= this.clientHeight;
if (CONDITION) {
if (CONDITION && !this.loadings) {
binding.value();
}
})
......@@ -174,6 +175,7 @@ export default {
getMemberGroupList() {
const { classifyName, pageNum } = this.params;
this.loading = true;
this.loadings = true;
if (pageNum == 1) {
this.groupList = [];
}
......@@ -190,7 +192,10 @@ export default {
this.groupList = this.groupList.concat(result.result.filter(el => el.classifyName != '未分类' && el.classifyName != null));
}
this.params.totalPage = result.totalPage;
}).finally(() => this.loading = false);
}).finally(() => {
this.loading = false;
this.loadings = false
});
},
checkGroup() {
this.loading = true;
......
......@@ -82,7 +82,7 @@ export default {
this.getMemberGroupList();
},
onScroll(e) {
if ((e.target.scrollTop + e.target.clientHeight) >= this.lists.length * 20) {
if ((e.target.scrollTop + e.target.clientHeight) >= this.lists.length * 20 && !this.memberGroupLoading) {
this.onPageNumChange();
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment