DemoSimpleTableFixedHeader.vue
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<script setup lang="ts">
const desserts = [
{
dessert: 'Frozen Yogurt',
calories: 159,
fat: 6,
carbs: 24,
protein: 4,
},
{
dessert: 'Ice cream sandwich',
calories: 237,
fat: 6,
carbs: 24,
protein: 4,
},
{
dessert: 'Eclair',
calories: 262,
fat: 6,
carbs: 24,
protein: 4,
},
{
dessert: 'Cupcake',
calories: 305,
fat: 6,
carbs: 24,
protein: 4,
},
{
dessert: 'Gingerbread',
calories: 356,
fat: 6,
carbs: 24,
protein: 4,
},
]
</script>
<template>
<VTable
height="250"
fixed-header
>
<thead>
<tr>
<th class="text-uppercase">
Desserts(100g Servings)
</th>
<th class="text-uppercase">
calories
</th>
<th class="text-uppercase">
Fat(g)
</th>
<th class="text-uppercase">
Carbs(g)
</th>
<th class="text-uppercase">
protein(g)
</th>
</tr>
</thead>
<tbody>
<tr
v-for="item in desserts"
:key="item.dessert"
>
<td>
{{ item.dessert }}
</td>
<td>
{{ item.calories }}
</td>
<td>
{{ item.fat }}
</td>
<td>
{{ item.carbs }}
</td>
<td>
{{ item.protein }}
</td>
</tr>
</tbody>
</VTable>
</template>