table.js
580 Bytes
import Mock from 'mockjs'
const data = Mock.mock({
'items|10': [{
id: '@id',
title: '@sentence(10, 10)',
'status|1': ['published', 'draft', 'deleted'],
username: '@sentence(1, 2)',
create_at: '@datetime',
pageviews: '@integer(10, 500)',
openid: '@sentence(1, 1)',
avatar:'----'
}]
})
export default [
{
url: '/yp/table/list',
type: 'get',
response: config => {
const items = data.items
return {
code: 20000,
data: {
total: items.length,
items: items
}
}
}
}
]