<VueList>
- The Root Component β
The root component that wires everything together. It manages the entire data lifecycle β state, filters, pagination, search, and API calls β and provides context for all child components.
Itβs the only component you must include. Every other component depends on the context provided by <VueList>
.
vue
<template>
<VueList>
<template #default="{...}">
<!-- Child Components-->
</template>
</VueList>
</template>
Props β
Prop | Default | Type |
---|---|---|
endpoint | String - requiredThe unique identifier for the data source. Passed to the requestHandler. It can be a URL or part of URL. | |
page | 1 | Number Initial page value. |
perPage | 25 | Number Initial number of items per page. |
sortBy | String Initial sorting field. | |
sortOrder | desc | String Initial sorting direction. Should be either asc or desc. |
search | String Initial search term. | |
requestHandler | Override the global requestHandler defined during plugin setup β ideal for module-specific logic. | |
version | String Number Optional identifier for stateManager . You can use this with endpoint to generate new unique keys for state and delete old stale keys. | |
hasPaginationHistory | true | Boolean VueList will append the current page number to the URL query params β improving back button support. |
paginationMode | pagination | String pagination: Shows page numbers and traditional navigation. loadMore: Loads more items on scroll or button click. |
Events β
Name | Arguments | Description |
---|---|---|
onItemSelect | WIP | |
onResponse | WIP | |
afterPageChange | WIP | |
afterLoadMore | WIP |
Slots β
default
β
The only slot available in <VueList>
is default
. It exposes a set of scoped variables that let you access and render the list state however you like.
Slot Props β
Key | Description |
---|---|
items | Array Array of items returned from the API |
response | Object Full response object from the requestHandler |
isLoading | Boolean Indicating whether the list is currently loading |
selection | Array Object containing selected item(s) if selection is enabled |
error | Error object if the request failed |
isEmpty | Boolean Indicating if the items array is empty |
context | Object The full context object same as passed to the requestHandler and stateManager |
refresh | Function Function to manually trigger a refetch |