feat(Table): improve expanded row (#2485)

This commit is contained in:
kyyy
2024-11-05 21:52:10 +07:00
committed by GitHub
parent 0b2a3989a2
commit 1acd01a440
7 changed files with 301 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
<script setup>
<script setup lang='ts'>
const people = [{
id: 1,
name: 'Lindsay Walton',
@@ -36,10 +36,15 @@ const people = [{
email: 'floyd.miles@example.com',
role: 'Member'
}]
const expand = ref({
openedRows: [people[0]],
row: {}
})
</script>
<template>
<UTable :rows="people">
<UTable v-model:expand="expand" :rows="people">
<template #expand="{ row }">
<div class="p-4">
<pre>{{ row }}</pre>