fix(Icon): should compatible with medel-o

This commit is contained in:
陈嘉涵 2019-12-29 16:40:15 +08:00
parent 657c1b3106
commit 7b905a6de8
2 changed files with 8 additions and 2 deletions

View File

@ -199,7 +199,8 @@ export default {
span {
display: block;
margin: -4px 0 16px;
height: 36px;
margin: -4px 0 4px;
padding: 0 5px;
color: @gray-7;
font-size: 12px;

View File

@ -27,8 +27,13 @@ function isImage(name?: string): boolean {
}
// compatible with legacy usage, should be removed in next major version
const LEGACY_MAP: Record<string, string> = {
medel: 'medal',
'medel-o': 'medal-o'
};
function correctName(name?: string) {
return name === 'medel' ? 'medal' : name;
return (name && LEGACY_MAP[name]) || name;
}
function Icon(