elmentui 分頁組件pagination遇到的問題,就是初始的current-page設置無效,進入頁面后一直是在第1頁,其實我默認設置跳轉到第2頁的。(。具體如下: <div class="pagination"> <el-pagination
background
layout="total,prev, pager, next"
:current-page="currentPage"
:page-size="pageSize"
:total="total">
</el-pagination>
</div>組件里的data:data:function() {
return {
flowDatas:[{}],
pageSize:15,
currentPage:2,
total:0,
}組件里methods: async initData() {
let r = await getFlowList({currentPage:this.curPage,pageSize:this.pageSize});
let res = r.data;
console.log(res); if(!Object.is(res.statusCode,200)) { this.$message.error("獲取流程列表信息失敗!")
}else {
let data = res.data; this.flowDatas = data.rows; this.total = data.totalCount; //this.currentPage = 5; 如果加上這句,就會跳轉到第5頁
}
}
elmentui 分頁組件pagination遇到的問題
HUWWW
2018-12-16 15:40:54