mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 18:40:22 +08:00
29 lines
612 B
TypeScript
29 lines
612 B
TypeScript
import { MockMethod } from 'vite-plugin-mock';
|
|
import { resultSuccess } from '../_util';
|
|
|
|
const demoList = (keyword) => {
|
|
const result = {
|
|
list: [] as any[],
|
|
};
|
|
for (let index = 0; index < 20; index++) {
|
|
result.list.push({
|
|
name: `${keyword ?? ''}选项${index}`,
|
|
id: `${index}`,
|
|
});
|
|
}
|
|
return result;
|
|
};
|
|
|
|
export default [
|
|
{
|
|
url: '/basic-api/select/getDemoOptions',
|
|
timeout: 1000,
|
|
method: 'get',
|
|
response: ({ query }) => {
|
|
const { keyword } = query;
|
|
console.log(keyword);
|
|
return resultSuccess(demoList(keyword));
|
|
},
|
|
},
|
|
] as MockMethod[];
|