|
14 | 14 | color="medium-emphasis"
|
15 | 15 | size="small"
|
16 | 16 | variant="text"
|
| 17 | + width="105" |
17 | 18 | border
|
18 | 19 | slim
|
19 | 20 | @click="toggleExpand(internalItem)"
|
|
35 | 36 |
|
36 | 37 | <tbody>
|
37 | 38 | <tr>
|
38 |
| - <td> |
| 39 | + <td class="py-2"> |
39 | 40 | <v-rating
|
40 | 41 | :model-value="item.details.rating"
|
41 | 42 | color="orange-darken-2"
|
42 | 43 | density="comfortable"
|
43 |
| - size="x-small" |
| 44 | + size="small" |
44 | 45 | half-increments
|
45 | 46 | readonly
|
46 | 47 | ></v-rating>
|
47 | 48 | </td>
|
48 |
| - <td>{{ item.details.synopsis }}</td> |
49 |
| - <td>{{ item.details.cast.join(', ') }}</td> |
| 49 | + <td class="py-2">{{ item.details.synopsis }}</td> |
| 50 | + <td class="py-2">{{ item.details.cast.join(', ') }}</td> |
50 | 51 | </tr>
|
51 | 52 | </tbody>
|
52 | 53 | </v-table>
|
|
59 | 60 |
|
60 | 61 | <script setup>
|
61 | 62 | const headers = [
|
62 |
| - { title: 'Title', key: 'title', align: 'start', sortable: true }, |
63 |
| - { title: 'Director', key: 'director' }, |
64 |
| - { title: 'Genre', key: 'genre' }, |
65 |
| - { title: 'Year', key: 'year', align: 'end' }, |
66 |
| - { title: 'Runtime(min)', key: 'runtime', align: 'end' }, |
| 63 | + { width: 300, title: 'Title', key: 'title', align: 'start', sortable: true }, |
| 64 | + { width: 250, title: 'Director', key: 'director' }, |
| 65 | + { width: 150, title: 'Genre', key: 'genre' }, |
| 66 | + { width: 100, title: 'Year', key: 'year', align: 'end' }, |
| 67 | + { width: 140, title: 'Runtime(min)', key: 'runtime', align: 'end' }, |
| 68 | + { width: 1, key: 'data-table-expand', align: 'end' }, // optional, to keep it as short as possible |
67 | 69 | ]
|
68 | 70 |
|
69 | 71 | const movies = [
|
|
129 | 131 | },
|
130 | 132 | ]
|
131 | 133 | </script>
|
| 134 | + |
| 135 | +<script> |
| 136 | + export default { |
| 137 | + data: () => ({ |
| 138 | + headers: [ |
| 139 | + { width: 300, title: 'Title', key: 'title', align: 'start', sortable: true }, |
| 140 | + { width: 250, title: 'Director', key: 'director' }, |
| 141 | + { width: 150, title: 'Genre', key: 'genre' }, |
| 142 | + { width: 100, title: 'Year', key: 'year', align: 'end' }, |
| 143 | + { width: 140, title: 'Runtime(min)', key: 'runtime', align: 'end' }, |
| 144 | + { width: 1, key: 'data-table-expand', align: 'end' }, // optional, to keep it as short as possible |
| 145 | + ], |
| 146 | + movies: [ |
| 147 | + { |
| 148 | + title: 'The Shawshank Redemption', |
| 149 | + director: 'Frank Darabont', |
| 150 | + genre: 'Drama', |
| 151 | + year: 1994, |
| 152 | + runtime: 142, |
| 153 | + details: { |
| 154 | + synopsis: 'Two imprisoned men bond over years, finding solace and redemption through acts of decency.', |
| 155 | + cast: ['Tim Robbins', 'Morgan Freeman'], |
| 156 | + rating: 3.5, |
| 157 | + }, |
| 158 | + }, |
| 159 | + { |
| 160 | + title: 'Inception', |
| 161 | + director: 'Christopher Nolan', |
| 162 | + genre: 'Sci-Fi', |
| 163 | + year: 2010, |
| 164 | + runtime: 148, |
| 165 | + details: { |
| 166 | + synopsis: 'A thief with the ability to enter dreams is tasked with stealing a secret from the subconscious.', |
| 167 | + cast: ['Leonardo DiCaprio', 'Joseph Gordon-Levitt'], |
| 168 | + rating: 5, |
| 169 | + }, |
| 170 | + }, |
| 171 | + { |
| 172 | + title: 'The Godfather', |
| 173 | + director: 'Francis Ford Coppola', |
| 174 | + genre: 'Crime', |
| 175 | + year: 1972, |
| 176 | + runtime: 175, |
| 177 | + details: { |
| 178 | + synopsis: 'The aging patriarch of a crime dynasty transfers control to his reluctant son.', |
| 179 | + cast: ['Marlon Brando', 'Al Pacino'], |
| 180 | + rating: 4.5, |
| 181 | + }, |
| 182 | + }, |
| 183 | + { |
| 184 | + title: 'Pulp Fiction', |
| 185 | + director: 'Quentin Tarantino', |
| 186 | + genre: 'Crime', |
| 187 | + year: 1994, |
| 188 | + runtime: 154, |
| 189 | + details: { |
| 190 | + synopsis: 'Interwoven stories of criminals, violence, and redemption in Los Angeles.', |
| 191 | + cast: ['John Travolta', 'Samuel L. Jackson'], |
| 192 | + rating: 4.5, |
| 193 | + }, |
| 194 | + }, |
| 195 | + { |
| 196 | + title: 'The Dark Knight', |
| 197 | + director: 'Christopher Nolan', |
| 198 | + genre: 'Action', |
| 199 | + year: 2008, |
| 200 | + runtime: 152, |
| 201 | + details: { |
| 202 | + synopsis: 'When the menace known as the Joker wreaks havoc and chaos on the people of Gotham, Batman must accept one of the greatest psychological and physical tests of his ability to fight injustice.', |
| 203 | + cast: ['Christian Bale', 'Heath Ledger'], |
| 204 | + rating: 4, |
| 205 | + }, |
| 206 | + }, |
| 207 | + ], |
| 208 | + }), |
| 209 | + } |
| 210 | +</script> |
0 commit comments