From 7ad1602dc9db876ff833a263f3c4d7523055fcd9 Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Wed, 11 Sep 2019 14:07:06 +0800 Subject: [PATCH] =?UTF-8?q?svg=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fis-conf.js | 8 +++++++- scss/base/_normalize.scss | 8 ++++++++ src/components/icons.tsx | 20 ++++++++++---------- src/icons/minus.svg | 5 ++++- src/icons/pencil.svg | 5 +++-- src/icons/plus.svg | 5 +++-- 6 files changed, 35 insertions(+), 16 deletions(-) diff --git a/fis-conf.js b/fis-conf.js index ce814fcbe..580a8c61e 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -40,7 +40,13 @@ fis.match('/src/icons/**.svg', { isJsLike: true, isMod: true, parser: [ - fis.plugin('svgr'), + fis.plugin('svgr', { + svgProps: { + class: "icon" + }, + prettier: false, + dimensions: false + }), fis.plugin('typescript', { importHelpers: true, esModuleInterop: true, diff --git a/scss/base/_normalize.scss b/scss/base/_normalize.scss index 3d217770f..88b5d9c3e 100644 --- a/scss/base/_normalize.scss +++ b/scss/base/_normalize.scss @@ -339,3 +339,11 @@ template { [hidden] { display: none; } + + +svg.icon { + width: 1rem; + height: 1rem; + // top: 0.125rem; + // position: relative; +} \ No newline at end of file diff --git a/src/components/icons.tsx b/src/components/icons.tsx index 131630f5a..6bea474cc 100644 --- a/src/components/icons.tsx +++ b/src/components/icons.tsx @@ -36,25 +36,25 @@ import PencilIcon from '../icons/pencil.svg'; // 兼容原来的用法,后续不直接试用。 // @ts-ignore -export const closeIcon = ; +export const closeIcon = ; // @ts-ignore -export const unDoIcon = ; +export const unDoIcon = ; // @ts-ignore -export const reDoIcon = ; +export const reDoIcon = ; // @ts-ignore -export const enterIcon = ; +export const enterIcon = ; // @ts-ignore -export const volumeIcon = ; +export const volumeIcon = ; // @ts-ignore -export const muteIcon = ; +export const muteIcon = ; // @ts-ignore -export const playIcon = ; +export const playIcon = ; // @ts-ignore -export const pauseIcon = ; +export const pauseIcon = ; // @ts-ignore -export const leftArrowIcon = ; +export const leftArrowIcon = ; // @ts-ignore -export const rightArrowIcon = ; +export const rightArrowIcon = ; const iconFactory: { [propName: string]: React.ReactType<{}>; diff --git a/src/icons/minus.svg b/src/icons/minus.svg index 67a9eb059..e5278cb7b 100644 --- a/src/icons/minus.svg +++ b/src/icons/minus.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/src/icons/pencil.svg b/src/icons/pencil.svg index 6edc00937..93052f73f 100644 --- a/src/icons/pencil.svg +++ b/src/icons/pencil.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file diff --git a/src/icons/plus.svg b/src/icons/plus.svg index c6c279275..5ebd036f0 100644 --- a/src/icons/plus.svg +++ b/src/icons/plus.svg @@ -1,3 +1,4 @@ - - + + \ No newline at end of file