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>
This commit is contained in:
M69W
2021-06-14 22:10:41 +08:00
committed by GitHub
parent bbce002be1
commit a03d3cc60c
4 changed files with 44 additions and 8 deletions

View File

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