table.js 538 B

1234567891011121314151617181920212223242526272829
  1. import Mock from 'mockjs'
  2. const data = Mock.mock({
  3. 'items|30': [{
  4. id: '@id',
  5. title: '@sentence(10, 20)',
  6. 'status|1': ['published', 'draft', 'deleted'],
  7. author: 'name',
  8. display_time: '@datetime',
  9. pageviews: '@integer(300, 5000)'
  10. }]
  11. })
  12. export default [
  13. {
  14. url: '/vue-admin-template/table/list',
  15. type: 'get',
  16. response: config => {
  17. const items = data.items
  18. return {
  19. code: 20000,
  20. data: {
  21. total: items.length,
  22. items: items
  23. }
  24. }
  25. }
  26. }
  27. ]