fix(icon): ensure icon data is valid (#4460)

close #2745
pull/4516/head
BeADre 2021-08-04 23:02:56 +08:00 committed by GitHub
parent b0d226d33e
commit 89c134a7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ import { filterEmpty, getListeners } from '../_util/props-util';
import Base from '../base';
// Initial setting
VueIcon.add(...Object.keys(allIcons).map(key => allIcons[key]));
// https://github.com/vueComponent/ant-design-vue/issues/2745
let validIcons = allIcons.default || allIcons;
VueIcon.add(...Object.keys(validIcons).map(key => validIcons[key]));
setTwoToneColor('#1890ff');
const defaultTheme = 'outlined';
let dangerousTheme;