el-table增加序号列,使用slot-scope作用域插槽,{{}}插值表达式显示数据,scope.$index是行索引,从0开始,行索引加1就是序号。

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

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐