Blame view

mock/demo/select-demo.ts 567 Bytes
1
2
3
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';
4
const list: any[] = [];
5
const demoList = (() => {
6
7
8
  const result = {
    list: list,
  };
9
  for (let index = 0; index < 20; index++) {
10
11
12
    result.list.push({
      name: `选项${index}`,
      id: `${index}`,
13
14
15
16
17
18
19
    });
  }
  return result;
})();

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