Answer the question
In order to leave comments, you need to log in
How to make a drop down table?
Hello everyone, how to make a dropdown table in Vuetify? So that when you click on a line, it opens and there is another table in it?
Answer the question
In order to leave comments, you need to log in
Use the slot expanded-item
:
<v-data-table
:headers="mainTableHeaders"
:items="mainTableItems"
item-key="mainTableItemKey"
show-expand
>
<template #expanded-item="{ headers, item }">
<td :colspan="headers.length">
<v-data-table
:headers="nestedTableHeaders"
:items="item.nestedTableItems"
></v-data-table>
</td>
</template>
</v-data-table>
when clicking on a line
show-expand
, add a click handler, where the display of additional content will be switched manually:methods: {
onRowClick(item, row) {
row.expand(!row.isExpanded);
},
...
<v-data-table
@click:row="onRowClick"
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question