Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add optional strong typing to DataTableColumn #2915

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/ui/src/components/va-data-table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export type DataTableSortingOptions = DataTableSortingOrder[]

// provided column definitions (<va-data-table `:columns="myColumns"` />)
// should look like an array of the following objects (and/or strings)
export type DataTableColumn = {
export type DataTableColumn<T = string> = {
[key: string]: any
key: string // name of an item's property: 'userName', 'address.zipCode'
key: T // name of an item's property: 'userName', 'address.zipCode'
name?: string // column unique name (used in slots)
label?: string // what to display in the respective heading
thTitle?: string // <th>'s `title` attribute's value
Expand Down