使用el-table的type=index有时不显示序号


问题描述:el-table中通过type=index来显示序号。发现有时候序号不能正常显示

分析:因为el-table使用v-if控制显示

问题解决:type=index换一种写法

<el-table-column label="序号" width="50" align="center">
    <template slot-scope="scope">{{scope.$index+1}}template>
el-table-column>

相关