Sep 3, 2018
0
Level 2
Eliment UI Table index problem
i have a eliment ui table. when i am click eliment ui pagination . after one page index start with 1 .
example : if first page 10 row. then legally second page row start index with 11 , 12 and so on but my index start with 1 , 2
Here is my Code
<el-table :data="adminlog" stripe border style="width: 100%"> <el-table-column type="index" label="ID" width="180"> </el-table-column>
<el-table-column
prop="created_at"
label="Login Time">
</el-table-column>
</el-table>
<el-pagination background class="fix" @current-change="handleCurrentChange" :page-size="perPage" layout="total, prev, pager, next" :total="totalData"> </el-pagination>
export default {
data () {
return {
adminlog:[],
perPage: 10,
totalData: 0,
}
},
methods: {
handleCurrentChange(next) {
this.TableData(next);
},
TableData(nextPage = null){
let url = `http://127.0.0.1:8000/admin/log-data?per_page=${this.perPage}`;
if (nextPage) {
url += `&page=${nextPage}`;
}
axios.get(url)
.then((response) => {
this.adminlog = response.data.adminLogList.data
this.totalData = response.data.adminLogList.total;
})
.catch((error) => {
})
}
},
mounted () {
this.TableData();
},
}
Please or to participate in this conversation.