topic description
is a background management page that creates a multi-page table with < el-table >. When changing pages, the serial number is refreshed first, and then the content is refreshed. The
code is as follows:
<el-table :data="getList" :row-class-name="tableRowClassName" header-row-class-name="header-class" class="tr-hover">
<!-- -->
<el-table-column width="65px" prop="index" label="" align="center">
<template slot-scope="scope">
<span>{{getIndex(scope.row.index+1)}}</span>
</template>
</el-table-column>
<el-table-column prop="time" min-width="12%" align="center" label="" class-name="data-color">
</el-table-column>
<el-table-column prop="name" min-width="7%" align="center" label="">
</el-table-column>
The data bound by the table is obtained by asynchronous method, as follows
async getAppList (page) {.}
async getSellerApplyList (page = 0) {
this.list = await this.getAppList(page);
},
computed: {
getList() {
return this.list;
}
where the sequence number is obtained through the getIndex method, as follows
getIndex(num) {
if (this.currentPage > 1) {
let index = (this.currentPage - 1) * this.limitCounts + num;
return index > this.total ? "" : index;
}
return num;
},
I have tried to get the serial number asynchronously, but failed.
did not find any related problems on the Internet, so I am here to ask for help on how to refresh Synchronize.