Solution: Use item-value in Vuetify 3 to prevent all rows from expanding at once
In Vuetify 3, when using <v-data-table> with expandable rows, it’s important to specify a unique identifier for each item using the item-value prop. If you don’t, Vuetify can’t properly track which row is being expanded, and as a result, all rows might expand at the same time.
To fix this, just add:
item-value=”menu_item_id”
Where menu_item_id is a unique key for each row item. Here’s how it looks in context:
<v-data-table
item-value=”menu_item_id”
:items=”menuSchemaCp[0]?.details”
:headers=”menuHeaders”
show-expand
…
>
This ensures that Vuetify correctly manages the expanded state for individual rows.