feat: common paginator component (#9)
This commit is contained in:
parent
7969b53747
commit
e61f909f31
6 changed files with 49 additions and 42 deletions
|
@ -5,18 +5,14 @@ const { paginator } = defineProps<{
|
|||
paginator: Paginator<any, Account[]>
|
||||
}>()
|
||||
|
||||
const { items: accounts, isLoading, isDone, endAnchor } = usePaginator(paginator)
|
||||
const { items: accounts, state, endAnchor } = usePaginator(paginator)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-for="account of accounts" :key="account.id">
|
||||
<AccountCard :account="account" border="t border" pt-4 />
|
||||
</template>
|
||||
<div ref="endAnchor" />
|
||||
<div v-if="isLoading">
|
||||
Loading...
|
||||
</div>
|
||||
<div v-if="isDone">
|
||||
End of list
|
||||
</div>
|
||||
<CommonPaginator :state="state">
|
||||
<template v-for="account of accounts" :key="account.id">
|
||||
<AccountCard :account="account" border="t border" pt-4 />
|
||||
</template>
|
||||
<div ref="endAnchor" />
|
||||
</CommonPaginator>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue