标签:def 递增 ret type pre 序号 sign method 取值
表格上
<el-table-column label="序号" type="index" :index=‘indexMethod‘ width="80" align="center"></el-table-column>
定义的分页
const defaultListQuery = { pageNum: 1, pageSize: 10 };
data属性
data() { return { listQuery: Object.assign({}, defaultListQuery), } },
indexMethod 方法
methods: { indexMethod (index) { let curpage = this.listQuery.pageNum //单前页码,具体看组件取值 let limitpage = this.listQuery.pageSize //每页条数,具体是组件取值 return (index+1) + (curpage-1)*limitpage } }
<el-table-column label="序号" type="index" :index=‘(index)=>{return (index+1) + (listQuery.pageNum-1)*listQuery.pageSize }‘></el-table-column>
标签:def 递增 ret type pre 序号 sign method 取值
原文地址:https://www.cnblogs.com/gnh96/p/13235209.html