This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,071 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { MockMethod } from 'vite-plugin-mock'; | ||
import { resultSuccess } from '../_util'; | ||
|
||
const demoList = (keyword, count = 20) => { | ||
const result = { | ||
list: [] as any[], | ||
}; | ||
for (let index = 0; index < count; index++) { | ||
result.list.push({ | ||
name: `${keyword ?? ''}选项${index}`, | ||
id: `${index}`, | ||
}); | ||
} | ||
return result; | ||
}; | ||
|
||
export default [ | ||
{ | ||
url: '/mock-api/select/getDemoOptions', | ||
timeout: 1000, | ||
method: 'get', | ||
response: ({ query }) => { | ||
const { keyword, count } = query; | ||
console.log(keyword); | ||
return resultSuccess(demoList(keyword, count)); | ||
}, | ||
}, | ||
] as MockMethod[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { request } from '@/utils/request'; | ||
|
||
/** | ||
* @description Get sample options value | ||
*/ | ||
export function optionsListApi(params?: any) { | ||
return request<{ list: { id: string; name: string }[] }>( | ||
{ | ||
url: '/select/getDemoOptions', | ||
method: 'get', | ||
params, | ||
}, | ||
{ | ||
isMock: true, | ||
isGetDataDirectly: true, | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.