DataView API
API reference docs for the Stash DataView
component. Learn about the props, CSS, and other APIs of this exported module.
Import
ts
import DataView from '@leaflink/stash/DataView.vue';
Props
Name | Type | Default | Description |
---|---|---|---|
currentPage | number | 1 | Can be used to provide the initial page. Also, it can be used to control the active page with `v-model:current-page="myPage"`. |
currentSearch | string | undefined | Can be used to set the initial search term. Also, it can be used to control the active search term with `v-model:current-search="mySearchTerm"`. |
currentSort | SortValue | undefined | Can be used to provide the initial sort order. Also, it can be used to control the active sort order with `v-model:current-sort="mySortOrder"`. |
data | Array | () => [] | A list of records. If pagination is enabled, `data` must be only the current page of records. |
density | SpacingDensities | comfortable | Controls the DataView's padding; the default value is "comfortable". On small screens, "compact" density is applied regardless of this prop's value. |
disablePagination | boolean | false | Opt-out of displaying pagination. Hides the pagination buttons and page stats. |
hideBottomPagination | boolean | false | Hides the bottom pagination without disabling the pagination from the toolbar |
isLoading | boolean | - | |
pageSize | number | DEFAULT_PAGE_SIZE | |
totalDataCount | number | 0 | The total number of records available. Used to auto-enable pagination when results exist. DataView does not paginate data for you; instead, `props.data` should always show the current page of results. |
variant | DataViewVariants | undefined | DataView variant. The default value is `undefined`. Will default to `table` when used within a `<Module variant="table">`. |
Slots
Name | Description |
---|---|
default | default |
Events
Name | Description |
---|---|
update | |
update:currentFilters | |
update:currentPage | |
update:currentSearch | |
update:currentSort |