gf-vben-admin/mock/demo/select-demo.ts
M69W a03d3cc60c
fix(ApiSelect demo): add demo about ApiSelect's use (#757)
* fix(ApiSelect demo): add demo about ApiSelect's use

* fix(ApiSelect demo): typo

* revert(ApiSelect): remove console

Co-authored-by: M69W <M69W@M69W>
2021-06-14 22:10:41 +08:00

29 lines
567 B
TypeScript

import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';
const list: any[] = [];
const demoList = (() => {
const result = {
list: list,
};
for (let index = 0; index < 20; index++) {
result.list.push({
name: `选项${index}`,
id: `${index}`,
});
}
return result;
})();
export default [
{
url: '/basic-api/select/getDemoOptions',
timeout: 1000,
method: 'post',
response: ({ query }) => {
console.log(query);
return resultSuccess(demoList);
},
},
] as MockMethod[];