mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-15 01:41:20 +08:00
61 lines
1.4 KiB
Vue
61 lines
1.4 KiB
Vue
|
<template>
|
||
|
<el-table :data="tableData" style="width: 100%">
|
||
|
<el-table-column type="index" :index="indexMethod" />
|
||
|
<el-table-column prop="date" label="Date" width="180" />
|
||
|
<el-table-column prop="name" label="Name" width="180" />
|
||
|
<el-table-column prop="address" label="Address" />
|
||
|
</el-table>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
export default {
|
||
|
data() {
|
||
|
return {
|
||
|
tableData: [
|
||
|
{
|
||
|
date: '2016-05-03',
|
||
|
name: 'Tom',
|
||
|
state: 'California',
|
||
|
city: 'Los Angeles',
|
||
|
address: 'No. 189, Grove St, Los Angeles',
|
||
|
zip: 'CA 90036',
|
||
|
tag: 'Home',
|
||
|
},
|
||
|
{
|
||
|
date: '2016-05-02',
|
||
|
name: 'Tom',
|
||
|
state: 'California',
|
||
|
city: 'Los Angeles',
|
||
|
address: 'No. 189, Grove St, Los Angeles',
|
||
|
zip: 'CA 90036',
|
||
|
tag: 'Office',
|
||
|
},
|
||
|
{
|
||
|
date: '2016-05-04',
|
||
|
name: 'Tom',
|
||
|
state: 'California',
|
||
|
city: 'Los Angeles',
|
||
|
address: 'No. 189, Grove St, Los Angeles',
|
||
|
zip: 'CA 90036',
|
||
|
tag: 'Home',
|
||
|
},
|
||
|
{
|
||
|
date: '2016-05-01',
|
||
|
name: 'Tom',
|
||
|
state: 'California',
|
||
|
city: 'Los Angeles',
|
||
|
address: 'No. 189, Grove St, Los Angeles',
|
||
|
zip: 'CA 90036',
|
||
|
tag: 'Office',
|
||
|
},
|
||
|
],
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
indexMethod(index) {
|
||
|
return index * 2
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
</script>
|