在Element-ui的table表格中,如何让分页的序号延续上一页的序号

2023-11-16

可以通过传递index属性来自定义索引

1.页面

<el-table-column
                        type="index"
                        label="序号"
                        width="100"
                        :index="hIndex"
                        show-overflow-tooltip
                      />

2.利用计算属性解决

computed: {
      hIndex() {
        // 当前页数 - 1 * 每页数据条数 + 1
        return (this.planTableCurrent - 1) * this.planTableSize + 1
      }
    },

3.利用函数方法解决问题

methods: {//方法
      hIndex(index) {
        // 当前页数 - 1 * 每页数据条数 + index + 1 ( index 是索引值,从0开始)
        return (this.planTableCurrent - 1) * this.planTableSize + index + 1
      },
}

相关链接

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在Element-ui的table表格中,如何让分页的序号延续上一页的序号 的相关文章

随机推荐