select-demo.ts 529 B

12345678910111213141516171819202122232425
  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: '/basic-api/select/getDemoOptions',
  16. timeout: 2000,
  17. method: 'get',
  18. response: ({ query }) => {
  19. console.log(query);
  20. return resultSuccess(demoList);
  21. },
  22. },
  23. ] as MockMethod[];