select-demo.ts 497 B

123456789101112131415161718192021222324
  1. import { MockMethod } from 'vite-plugin-mock';
  2. import { resultSuccess } from '../_util';
  3. const demoList = (() => {
  4. const result: any[] = [];
  5. for (let index = 0; index < 20; index++) {
  6. result.push({
  7. label: `选项${index}`,
  8. value: `${index}`,
  9. });
  10. }
  11. return result;
  12. })();
  13. export default [
  14. {
  15. url: '/api/select/getDemoOptions',
  16. timeout: 4000,
  17. method: 'get',
  18. response: ({ query }) => {
  19. return resultSuccess(demoList);
  20. },
  21. },
  22. ] as MockMethod[];