当在<el-table>
标签上绑定:data的时候,可以使用:slot-scope="{ row }" ,或者用slot-scope="scope"配合scope.row来得到一整行的数据。例如:
<el-table-column min-width="120" label="待办">
<template slot-scope="{row}">
<span v-if="row.agency === 'success'">通过</span>
<span v-if="row.agency === 'wait'">等待/span>
</template>
</el-table-column>
<!-- 或者是: -->
<el-table-column min-width="120" label="待办">
<template slot-scope="scope">
<span v-if="scope.row.agency === 'success'">通过</span>
<span v-if="scope.row.agency === 'wait'">等待/span>
</template>
</el-table-column>