1,根据接口调用时间设置loading:
const fn = async () => {
const loading = message.loading({...}, 0); // 自己控制它
await selectDeleteAll(); // 利用await去执行请求
loading(); // 关闭loading
}
或者
const loading = message.loading({...}, 0);
doPromise().then(() => loading());
参考:https://www.safekodo.com/wiki/content/18169709.html
2,typescript-interface中,定义数组
interface EnumServiceItem {
id: number; label: string; key: any
}
interface EnumServiceItems extends Array<EnumServiceItem>{}
或
interface AppServiceInfoListItem{
showTag:number,
serviceUrl:string,
serviceName:string,
tagName?:string,
serviceId:number
}
export interface SpecialCategoryInfo{
categoryName:string,
appServiceInfoList:AppServiceInfoListItem[],
categoryId:number
}
参考:https://qa.1r1g.com/sf/ask/1782847111/