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  小刺猬的大宝贝  阅读(13815)  评论(1编辑  收藏  举报