Merge branch 'main' into shen

bak
Dragon 1 year ago
commit c2ed424995

@ -11,6 +11,7 @@ const activeId = ref("");
const el = ref<HTMLDivElement | null>(null);
const keyword = ref("");
const canloadMore = ref(true);
const isLoading = ref(false);
defineProps({
showFieldList: {
@ -29,7 +30,7 @@ function selectHandler(id: string, index: number) {
taskStore.setActive(index);
}
const { isLoading } = useInfiniteScroll(
useInfiniteScroll(
el as any,
() => {
loadMore();
@ -39,8 +40,13 @@ const { isLoading } = useInfiniteScroll(
async function loadMore() {
if (isLoading.value || el.value == null) return;
isLoading.value = true;
try {
const more = await fetchList();
data.value.push(...more);
} finally {
isLoading.value = false;
}
}
async function fetchList() {

Loading…
Cancel
Save