赞
踩
- <el-table-column label="排名" width="100" align="center">
- <template slot-scope="scope">{{
- scope.$index + 1 > 9 ? scope.$index + 1 : "0" + (scope.$index + 1)
- }}</template>
- </el-table-column>
- <div class="stream-goods table mtmg">
- <el-table
- :row-class-name="rowClassName"
- >
- <el-table-column
- label="序号"
- align="center"
- prop="xh"
- width="50"
- ></el-table-column>
-
- rowClassName({ row, rowIndex }) {
- row.xh = rowIndex + 1;
- if (row.xh < 10) {
- row.xh = "0" + row.xh;
- }
- },
这两个都是个位数补零的序号排列
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。