table里面的赋值
<el-table ref="multipleTable" :data="tableData3">//tableData3是在data里面定义的一个数组。
<el-table-column label="日期" width="120" prop="date" > //下面这个date对应的就是data数据里面的tableData3这个数组里的date字段
</el-table-column>
</el-table>
data() {
return {
tableData3: [{ date: '2016-05-03', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄' }, { date: '2016-05-02', name: '王小虎', address: '上海市普陀区金沙江路 1518 弄' }]
}
1,使用prop
<el-table-column label="日期" width="120" prop="date" ></el-table-column>
2.嵌套一个template
<el-table-column label="日期" width="120" >
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column>
除了赋值以外还可以给他加其他的内容,比如加个图标
<el-table-column label="日期" width="180">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.date }}</span>
</template>
</el-table-column>