提交 b15caf63 编写于 作者: P Pan

fix tabel demo bug

上级 3466b9fe
......@@ -13,7 +13,7 @@
<el-table-column prop="name" label="fruitName" width="180"></el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">
<template scope="scope">
{{scope.row.list[index].value}}
{{scope.row[fruit]}}
</template>
</el-table-column>
</el-table>
......@@ -28,20 +28,16 @@
return {
tableData: [
{
name: 'fruit1',
list: [
{ name: 'apple1', value: 10 },
{ name: 'banana1', value: 20 },
{ name: 'orange1', value: 20 }
]
name: 'fruit-1',
apple: 'apple-10',
banana: 'banana-10',
orange: 'orange-10'
},
{
name: 'fruit2',
list: [
{ name: 'apple2', value: 12 },
{ name: 'banana2', value: 22 },
{ name: 'orange2', value: 20 }
]
name: 'fruit-2',
apple: 'apple-20',
banana: 'banana-20',
orange: 'orange-20'
}
],
key: 1, // table key
......
......@@ -14,7 +14,7 @@
</el-table-column>
<el-table-column :key='fruit' v-for='(fruit,index) in formThead' :label="fruit">
<template scope="scope">
{{scope.row.list[index].value}}
{{scope.row[fruit]}}
</template>
</el-table-column>
</el-table>
......@@ -28,20 +28,16 @@
return {
tableData: [
{
name: 'fruit1',
list: [
{ name: 'apple1', value: 10 },
{ name: 'banana1', value: 20 },
{ name: 'orange1', value: 20 }
]
name: 'fruit-1',
apple: 'apple-10',
banana: 'banana-10',
orange: 'orange-10'
},
{
name: 'fruit2',
list: [
{ name: 'apple2', value: 12 },
{ name: 'banana2', value: 22 },
{ name: 'orange2', value: 20 }
]
name: 'fruit-2',
apple: 'apple-20',
banana: 'banana-20',
orange: 'orange-20'
}
],
formThead: ['apple', 'banana']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册