mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-17 23:06:45 +08:00
案例加载更多显示问题
This commit is contained in:
@@ -344,6 +344,17 @@ export default {
|
|||||||
window.removeEventListener("scroll", this.handleScroll);
|
window.removeEventListener("scroll", this.handleScroll);
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
displayAll(item) {
|
||||||
if (!item.isAll && item.summary && item.summary.length > 190) {
|
if (!item.isAll && item.summary && item.summary.length > 190) {
|
||||||
@@ -426,8 +437,8 @@ export default {
|
|||||||
let outerHeight = document.documentElement.clientHeight;
|
let outerHeight = document.documentElement.clientHeight;
|
||||||
let scrollTop = document.documentElement.scrollTop;
|
let scrollTop = document.documentElement.scrollTop;
|
||||||
if (outerHeight + scrollTop + 350 >= innerHeight) {
|
if (outerHeight + scrollTop + 350 >= innerHeight) {
|
||||||
if (this.moreState == 1 && this.queryCondition.pageIndex < 4) {
|
if (this.moreState == 1) {
|
||||||
this.loadMore();
|
this.debounce(this.loadMore(),5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scrollTop > 630) {
|
if (scrollTop > 630) {
|
||||||
|
|||||||
Reference in New Issue
Block a user