let list = []
let pageSize = 10
let pageNo = 1
// 刷新
function refresh(){
list = []
pageNo = 1;
loadMore...()
}
// 加载更多
function loadMore(){
for(let i = (pageNo - 1) * 10 + 1; i <= pageNo * pageSize; i++) {...list.push(i)
}
pageNo++
console.log(list)
}
loadMore()
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]...loadMore()
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
......, directives[key]);
});
},
};
指令使用
<div
class="list"
v-infinite-scroll="<em>loadMore</em>