element-ui 表格添加序号列问题

558 阅读1分钟

bhlAeO.png

<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>