style: update message

pull/5820/head
tangjinzhou 2022-05-19 16:38:19 +08:00
parent 6e41fbd01f
commit c1a1b93553
1 changed files with 2 additions and 4 deletions

View File

@ -105,7 +105,7 @@ const typeToIcon = {
warning: ExclamationCircleFilled, warning: ExclamationCircleFilled,
loading: LoadingOutlined, loading: LoadingOutlined,
}; };
export const typeList = Object.keys(typeToIcon) as NoticeType[];
export interface MessageType extends PromiseLike<any> { export interface MessageType extends PromiseLike<any> {
(): void; (): void;
} }
@ -220,9 +220,7 @@ export function attachTypeApi(originalApi: MessageApi, type: NoticeType) {
}; };
} }
(['success', 'info', 'warning', 'error', 'loading'] as NoticeType[]).forEach(type => typeList.forEach(type => attachTypeApi(api, type));
attachTypeApi(api, type),
);
api.warn = api.warning; api.warn = api.warning;