From 7b317a27655f5714301cd8e050c2ef6f4b3d6933 Mon Sep 17 00:00:00 2001 From: BeADre Date: Fri, 27 Aug 2021 10:04:33 +0800 Subject: [PATCH] fix(icon): fix the warning of not export default at webpack5 (#4579) --- components/icon/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/icon/index.js b/components/icon/index.js index ede29257e..98bad5fc3 100644 --- a/components/icon/index.js +++ b/components/icon/index.js @@ -19,9 +19,11 @@ import Base from '../base'; // Initial setting // https://github.com/vueComponent/ant-design-vue/issues/2745 -let validIcons = allIcons.default || allIcons; - -VueIcon.add(...Object.keys(validIcons).map(key => validIcons[key])); +VueIcon.add( + ...Object.keys(allIcons) + .filter(key => key !== 'default') + .map(key => allIcons[key]), +); setTwoToneColor('#1890ff'); const defaultTheme = 'outlined'; let dangerousTheme;