feat(Form): 新增 ApiRadioGroup 组件

This commit is contained in:
zuihou
2021-10-16 21:25:57 +08:00
parent 34781d42e8
commit 89414f173e
6 changed files with 182 additions and 4 deletions

View File

@@ -1,11 +1,11 @@
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';
const demoList = (keyword) => {
const demoList = (keyword, count = 20) => {
const result = {
list: [] as any[],
};
for (let index = 0; index < 20; index++) {
for (let index = 0; index < count; index++) {
result.list.push({
name: `${keyword ?? ''}选项${index}`,
id: `${index}`,
@@ -20,9 +20,9 @@ export default [
timeout: 1000,
method: 'get',
response: ({ query }) => {
const { keyword } = query;
const { keyword, count } = query;
console.log(keyword);
return resultSuccess(demoList(keyword));
return resultSuccess(demoList(keyword, count));
},
},
] as MockMethod[];