You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
834 B
67 lines
834 B
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
|
|
}
|