案例加载更多显示问题

This commit is contained in:
zhaofang
2022-06-08 14:21:45 +08:00
parent a9d11d71b2
commit e91bb9db85

View File

@@ -344,6 +344,17 @@ export default {
window.removeEventListener("scroll", this.handleScroll);
},
methods: {
debounce(func, wait) {// 非立即执行
let timeout;
return function () {
let context = this;
let args = arguments;
if (timeout) clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(context, args)
}, wait);
}
},
//展示全部
displayAll(item) {
if (!item.isAll && item.summary && item.summary.length > 190) {
@@ -426,8 +437,8 @@ export default {
let outerHeight = document.documentElement.clientHeight;
let scrollTop = document.documentElement.scrollTop;
if (outerHeight + scrollTop + 350 >= innerHeight) {
if (this.moreState == 1 && this.queryCondition.pageIndex < 4) {
this.loadMore();
if (this.moreState == 1) {
this.debounce(this.loadMore(),5000);
}
}
if (scrollTop > 630) {