parent
20bcb15194
commit
a429f4dd08
@ -1,66 +0,0 @@
|
|||||||
const data = [
|
|
||||||
{
|
|
||||||
id:1,
|
|
||||||
name:'a',
|
|
||||||
age:10,
|
|
||||||
birth:'2022-01-01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:2,
|
|
||||||
name:'b',
|
|
||||||
age:11,
|
|
||||||
birth:'2022-01-01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:3,
|
|
||||||
name:'c',
|
|
||||||
age:14,
|
|
||||||
birth:'2022-01-01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:4,
|
|
||||||
name:'b',
|
|
||||||
age:11,
|
|
||||||
birth:'2022-01-01'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:5,
|
|
||||||
name:'e',
|
|
||||||
age:20,
|
|
||||||
birth:'2022-01-02'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:6,
|
|
||||||
name:'f',
|
|
||||||
age:20,
|
|
||||||
birth:'2022-01-02'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:7,
|
|
||||||
name:'g',
|
|
||||||
age:20,
|
|
||||||
birth:'2022-01-02'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id:8,
|
|
||||||
name:'h',
|
|
||||||
age:20,
|
|
||||||
birth:'2022-01-02'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const getData = (params) => {
|
|
||||||
const { page,page_size } = params
|
|
||||||
let start = (page - 1) * page_size
|
|
||||||
let res = data.slice(start,start + page_size)
|
|
||||||
return {
|
|
||||||
per_page:page_size,
|
|
||||||
total:data.length,
|
|
||||||
data:res,
|
|
||||||
current_page:page
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
getData
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue