Blame view

mock/demo/select-demo.ts 529 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 20; index++) {
    result.push({
      label: `选项${index}`,
      value: `${index}`,
    });
  }
  return result;
})();

export default [
  {
17
    url: '/basic-api/select/getDemoOptions',
18
    timeout: 2000,
19
20
    method: 'get',
    response: ({ query }) => {
vben authored
21
      console.log(query);
22
23
24
25
      return resultSuccess(demoList);
    },
  },
] as MockMethod[];