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
+6 -1
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(