Таблица починина

This commit is contained in:
iriska-gri committed 2024-03-06 12:33:31 +03:00
1 parent 323ff1242d
commit 09a192e83e
1 file changed
+24 -26
@@ -5,35 +5,14 @@
> >
<template v-slot:filling> <template v-slot:filling>
<my-helper :pretext="expanded"/>
<!-- <v-data-table
v-model:expanded="expanded"
:headers="dessertHeaders"
:items="dataActivusers"
item-value="user.fio"
show-expand
>
<template v-slot:top>
<v-toolbar flat>
<v-toolbar-title>Expandable Table</v-toolbar-title>
</v-toolbar>
</template>
<template v-slot:expanded-row="{ columns, item }">
<tr>
<td :colspan="columns.length">
More info about {{ item.name }}
</td>
</tr>
</template>
</v-data-table> -->
<v-data-table-virtual <v-data-table-virtual
v-model:expanded="expanded" v-model:expanded="expanded"
:headers="dessertHeaders" :headers="dessertHeaders"
:items="dataActivusers" :items="dataActivusers"
item-value="user.fio" item-value="user.id"
show-expand show-expand
class="h-0 cursor-default " class="h-0 cursor-default "
:sort-by="[{ key: 'info.count', order: 'desc' }]" :sort-by="[{ key: 'info.count', order: 'desc' }]"
@@ -46,6 +25,7 @@
:from_which = "'top-user'" :from_which = "'top-user'"
/> />
</template> </template>
<template v-slot:headers="{ columns, isSorted, getSortIcon, toggleSort }"> <template v-slot:headers="{ columns, isSorted, getSortIcon, toggleSort }">
<tr> <tr>
<template v-for="column in columns" :key="column.key"> <template v-for="column in columns" :key="column.key">
@@ -79,7 +59,7 @@
More info about {{ item.name }} More info about {{ item.name }}
</td> </td>
</tr> </tr>
<!-- <tr> <tr>
<td :colspan="columns.length"> <td :colspan="columns.length">
<v-card class="my-2 elevation-0" color='grey'> <v-card class="my-2 elevation-0" color='grey'>
<v-divider/> <v-divider/>
@@ -131,7 +111,7 @@
</td> </td>
</tr> --> </tr>
</template> </template>
</v-data-table-virtual> </v-data-table-virtual>
@@ -163,6 +143,24 @@ export default {
}, },
setup(props) { setup(props) {
const desserts = [
{
name: 'Frozen Yogurt',
calories: 159,
fat: 6.0,
carbs: 24,
protein: 4.0,
iron: 1,
},
{
name: 'Ice cream sandwich',
calories: 237,
fat: 9.0,
carbs: 37,
protein: 4.3,
iron: 1,
}]
const dataActivusers = computed({ const dataActivusers = computed({
get() { get() {
@@ -278,7 +276,7 @@ export default {
subtable, subtable,
getColor, getColor,
getColor2, getColor2,
desserts
} }
} }