表格代码:黄色部分为序号列关键代码
上图:
<el-table
:data="tableData"
border
height="480"
style="width: 100%">
<el-table-column
label="序号"
width="70px">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column
prop="name"
label="项目编号">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="info"
@click="handleDelete(scope.$index, scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>