vue-vben-admin/mock/demo/select-demo.ts

26 lines
529 B
TypeScript
Raw Normal View History

2020-12-27 22:25:35 +08:00
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 [
{
url: '/basic-api/select/getDemoOptions',
2020-12-27 22:25:35 +08:00
timeout: 4000,
method: 'get',
response: ({ query }) => {
2021-02-09 23:47:14 +08:00
console.log(query);
2020-12-27 22:25:35 +08:00
return resultSuccess(demoList);
},
},
] as MockMethod[];