<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 | NumberInitial page value. |
| perPage | 25 | NumberInitial number of items per page. |
| sortBy | StringInitial sorting field. | |
| sortOrder | desc | StringInitial 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 NumberOptional identifier for stateManager. You can use this with endpoint to generate new unique keys for state and delete old stale keys. | |
| hasPaginationHistory | true | BooleanVueList will append the current page number to the URL query params β improving back button support. |
| paginationMode | pagination | Stringpagination: 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 | ObjectThe full context object same as passed to the requestHandler and stateManager |
| refresh | FunctionFunction to manually trigger a refetch |