feat: more list support (#1479)

This commit is contained in:
Evan Boehs 2023-01-27 10:15:46 -05:00 committed by GitHub
parent 9d353fa07b
commit e393049f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 212 additions and 1 deletions

View file

@ -11,6 +11,7 @@ const {
virtualScroller = false,
eventType = 'update',
preprocess,
noEndMessage = false,
} = defineProps<{
paginator: Paginator<T[], O>
keyProp?: keyof T
@ -18,6 +19,7 @@ const {
stream?: Promise<WsEvents>
eventType?: 'notification' | 'update'
preprocess?: (items: (U | T)[]) => U[]
noEndMessage?: boolean
}>()
defineSlots<{
@ -84,7 +86,7 @@ const { items, prevItems, update, state, endAnchor, error } = usePaginator(pagin
<slot v-if="state === 'loading'" name="loading">
<TimelineSkeleton />
</slot>
<slot v-else-if="state === 'done'" name="done">
<slot v-else-if="state === 'done' && !noEndMessage" name="done">
<div p5 text-secondary italic text-center>
{{ t('common.end_of_list') }}
</div>