-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(data-table#4421): correct key on expandable table (#4427)
- Loading branch information
Showing
3 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,3 +228,88 @@ export const NoFilteredDataText = () => ({ | |
<VaDataTable :items="[{ name: 'BbB' }]" :columns="columns" filter="Aaa" no-data-filtered-html="Test no filtered data" /> | ||
`, | ||
}) | ||
|
||
export const ExpandableRowFilter = () => ({ | ||
components: { VaDataTable, VaPagination }, | ||
data () { | ||
const items = [ | ||
{ | ||
id: 1, | ||
name: 'Leanne Graham', | ||
username: 'Bret', | ||
email: '[email protected]', | ||
phone: '1-770-736-8031', | ||
website: 'hildegard.org', | ||
}, | ||
{ | ||
id: 2, | ||
name: 'Ervin Howell', | ||
username: 'Antonette', | ||
email: '[email protected]', | ||
phone: '010-692-6593', | ||
website: 'anastasia.net', | ||
}, | ||
{ | ||
id: 3, | ||
name: 'Clementine Bauch', | ||
username: 'Samantha', | ||
email: '[email protected]', | ||
phone: '1-463-123-4447', | ||
website: 'ramiro.info', | ||
}, | ||
{ | ||
id: 4, | ||
name: 'Patricia Lebsack', | ||
username: 'Karianne', | ||
email: '[email protected]', | ||
phone: '493-170-9623', | ||
website: 'kale.biz', | ||
}, | ||
{ | ||
id: 5, | ||
name: 'Chelsey Dietrich', | ||
username: 'Kamren', | ||
email: '[email protected]', | ||
phone: '(254)954-1289', | ||
website: 'demarco.info', | ||
}, | ||
] | ||
|
||
const columns = [ | ||
{ key: 'name' }, | ||
{ key: 'username' }, | ||
{ key: 'email' }, | ||
{ key: 'actions', width: 80 }, | ||
] | ||
const filter = ref('') | ||
|
||
return { | ||
items, | ||
columns, | ||
filter, | ||
} | ||
}, | ||
|
||
template: ` | ||
<input v-model="filter"/> | ||
<VaDataTable | ||
:items="items" | ||
:columns="columns" | ||
:filter="filter" | ||
> | ||
<template #cell(actions)="{ row, isExpanded }"> | ||
<button | ||
@click="row.toggleRowDetails()" | ||
> | ||
{{ isExpanded ? 'Hide': 'More info' }} | ||
</button> | ||
</template> | ||
<template #expandableRow="{ rowData }" > | ||
<div> | ||
{{ rowData }} | ||
</div> | ||
</template> | ||
</VaDataTable> | ||
`, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters