style: update message
parent
6e41fbd01f
commit
c1a1b93553
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue