From e82c6528e471b454ab9f248b8cddbe52901dfadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 19 Apr 2022 18:05:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9svg-icon=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SvgIcon/index.vue | 24 ++++++++---------------- src/components/SvgIcon/svgicon.js | 14 +++++++------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue index bb66d79..2111e5a 100644 --- a/src/components/SvgIcon/index.vue +++ b/src/components/SvgIcon/index.vue @@ -13,11 +13,11 @@ export default defineComponent({ }, className: { type: String, - default: "", + default: '', }, color: { type: String, - default: "", + default: '', }, }, setup(props) { @@ -25,29 +25,21 @@ export default defineComponent({ iconName: computed(() => `#icon-${props.iconClass}`), svgClass: computed(() => { if (props.className) { - return `svg-icon ${props.className}`; + return `svg-icon ${props.className}` } - return "svg-icon"; + return 'svg-icon' }), - }; + } }, -}); +}) diff --git a/src/components/SvgIcon/svgicon.js b/src/components/SvgIcon/svgicon.js index 4431719..bb68b67 100644 --- a/src/components/SvgIcon/svgicon.js +++ b/src/components/SvgIcon/svgicon.js @@ -1,10 +1,10 @@ import * as components from '@element-plus/icons-vue' export default { - install: (app) => { - for (const key in components) { - const componentConfig = components[key]; - app.component(componentConfig.name, componentConfig); - } - }, -}; + install: (app) => { + for (const key in components) { + const componentConfig = components[key]; + app.component(componentConfig.name, componentConfig); + } + }, +}; \ No newline at end of file