Element ui中 el-table同时使用 type=“selection“ 和type=“index“时,设置序号的不显示了
项目中使用element ui 中el-table的多选项及序号时发现序号不显示了,单独设置一个可以显示
例如只设置序号或者只设置多选项可以正常显示
//只设置多选项列时可以正常显示
<el-table>
<el-table-column type="selection" width="50"></el-table-column>
......
<el-table>
// 只设置序号列时也可以正常显示
<el-table>
<el-table-column lable="序号" type="index" width="50"></el-table-column>
......
<el-table>
同时设置选择项跟序号时页面不显示序号
<el-table>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column lable="序号" type="index" width="50"></el-table-column>
......
<el-table>
修改代码如下
<el-table>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column lable="序号" type="index" width="50">
<template slot-scope="scope">
{{ scope.$index+1 }}
</template>
</el-table-column>
......
<el-table>
推荐阅读:
扫描二维码,在手机上阅读