2021-09-17 00:18:50 +08:00
|
|
|
<template>
|
2022-07-04 12:03:08 +08:00
|
|
|
switch parent border: <el-switch v-model="parentBorder" /> switch child
|
|
|
|
border: <el-switch v-model="childBorder" />
|
|
|
|
<el-table :data="tableData" :border="parentBorder" style="width: 100%">
|
2021-09-17 00:18:50 +08:00
|
|
|
<el-table-column type="expand">
|
|
|
|
<template #default="props">
|
2022-05-03 14:02:56 +08:00
|
|
|
<div m="4">
|
|
|
|
<p m="t-0 b-2">State: {{ props.row.state }}</p>
|
|
|
|
<p m="t-0 b-2">City: {{ props.row.city }}</p>
|
|
|
|
<p m="t-0 b-2">Address: {{ props.row.address }}</p>
|
|
|
|
<p m="t-0 b-2">Zip: {{ props.row.zip }}</p>
|
2022-07-04 12:03:08 +08:00
|
|
|
<h3>Family</h3>
|
|
|
|
<el-table :data="props.row.family" :border="childBorder">
|
|
|
|
<el-table-column label="Name" prop="name" />
|
|
|
|
<el-table-column label="State" prop="state" />
|
|
|
|
<el-table-column label="City" prop="city" />
|
|
|
|
<el-table-column label="Address" prop="address" />
|
|
|
|
<el-table-column label="Zip" prop="zip" />
|
|
|
|
</el-table>
|
2022-05-03 14:02:56 +08:00
|
|
|
</div>
|
2021-09-17 00:18:50 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="Date" prop="date" />
|
|
|
|
<el-table-column label="Name" prop="name" />
|
|
|
|
</el-table>
|
|
|
|
</template>
|
|
|
|
|
2021-12-21 15:51:33 +08:00
|
|
|
<script lang="ts" setup>
|
2022-07-04 12:03:08 +08:00
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
const parentBorder = ref(false)
|
|
|
|
const childBorder = ref(false)
|
2021-12-21 15:51:33 +08:00
|
|
|
const tableData = [
|
|
|
|
{
|
|
|
|
date: '2016-05-03',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-09-17 00:18:50 +08:00
|
|
|
},
|
2021-12-21 15:51:33 +08:00
|
|
|
{
|
|
|
|
date: '2016-05-02',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
date: '2016-05-04',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
date: '2016-05-01',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
date: '2016-05-08',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
date: '2016-05-06',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
date: '2016-05-07',
|
|
|
|
name: 'Tom',
|
|
|
|
state: 'California',
|
2022-07-04 12:03:08 +08:00
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
family: [
|
|
|
|
{
|
|
|
|
name: 'Jerry',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Spike',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Tyke',
|
|
|
|
state: 'California',
|
|
|
|
city: 'San Francisco',
|
|
|
|
address: '3650 21st St, San Francisco',
|
|
|
|
zip: 'CA 94114',
|
|
|
|
},
|
|
|
|
],
|
2021-12-21 15:51:33 +08:00
|
|
|
},
|
|
|
|
]
|
2021-09-17 00:18:50 +08:00
|
|
|
</script>
|