vue表格index序号随着分页的增加而增加
模版:
<el-table-column type="index" label="序号" width="60" :index="tableIndex" />
vue3中的js写法:
const state = reactive ({ page:{ currentPage:1, pageSize:30, total:0 }, }); const tableIndex = (index) => { return (state.page.currentPage-1) * state.page.pageSize + index + 1; }; return { ...toRefs(state), tableIndex, };