table.ts 559 B

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