template
<template
>
<el
-pagination
@size
-change
='handleSizeChange'
background
@current
-change
='handleCurrentChange'
:current
-page
='queryInfo.pagenum'
:page
-sizes
='[5,10,15,20,50]'
:page
-size
='queryInfo.pagesize'
layout
='total,sizes,prev,pager,next,jumper'
:total
='total'>
</el
-pagination
>
</template
>
data
data(){
return{
queryInfo
:{
pagenum
:1,
pagesize
:10
},
total
:'',
}
}
methods
async getCateList(){
const {data
: res
} = await this.$axios
.get('接口Url',{
params
:{
current
:this.queryInfo
.pagenum
,
size
:this.queryInfo
.pagesize
},
headers
:{
"token": "bearer " + "accessToken"
}
console
.log(res
)
})
},
handleSizeChange(val
){
this.queryInfo
.pagesize
= val
;
this.getCateList()
},
handleCurrentChange(val
){
this.queryInfo
.pagenum
= val
;
this.getCateList()
},
调用this.getCateList方法
转载请注明原文地址:https://ipadbbs.8miu.com/read-13424.html