mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 22:06:43 +08:00
案例加载更多显示问题
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user