element表格添加序号

表格代码:黄色部分为序号列关键代码
上图:

<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>
posted @ 2019-04-23 18:37  青石小巷  阅读(13834)  评论(1编辑  收藏  举报