From 24602755cd879caddf88af01ff7e144db521c5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E8=A3=A4=E8=A1=A9?= Date: Mon, 17 Sep 2018 13:07:11 +0800 Subject: [PATCH] refactor: svg icons (#1096) * refactor svg * add svgo * refine * add tree.svg * add svg.yml --- package.json | 4 +++- src/icons/svg/404.svg | 2 +- src/icons/svg/bug.svg | 2 +- src/icons/svg/chart.svg | 2 +- src/icons/svg/clipboard.svg | 2 +- src/icons/svg/component.svg | 2 +- src/icons/svg/dashboard.svg | 2 +- src/icons/svg/documentation.svg | 2 +- src/icons/svg/drag.svg | 2 +- src/icons/svg/edit.svg | 2 +- src/icons/svg/email.svg | 2 +- src/icons/svg/example.svg | 2 +- src/icons/svg/excel.svg | 2 +- src/icons/svg/eye.svg | 2 +- src/icons/svg/form.svg | 2 +- src/icons/svg/guide 2.svg | 1 + src/icons/svg/guide.svg | 2 +- src/icons/svg/icon.svg | 2 +- src/icons/svg/international.svg | 2 +- src/icons/svg/language.svg | 2 +- src/icons/svg/link.svg | 2 +- src/icons/svg/list.svg | 2 +- src/icons/svg/lock.svg | 2 +- src/icons/svg/message.svg | 2 +- src/icons/svg/money.svg | 2 +- src/icons/svg/nested.svg | 2 +- src/icons/svg/password.svg | 2 +- src/icons/svg/people.svg | 2 +- src/icons/svg/peoples.svg | 2 +- src/icons/svg/qq.svg | 2 +- src/icons/svg/shopping.svg | 1 + src/icons/svg/shoppingCard.svg | 1 - src/icons/svg/size.svg | 3 +-- src/icons/svg/star.svg | 2 +- src/icons/svg/tab.svg | 2 +- src/icons/svg/table.svg | 2 +- src/icons/svg/theme.svg | 2 +- src/icons/svg/tree.svg | 1 + src/icons/svg/user.svg | 2 +- src/icons/svg/wechat.svg | 2 +- src/icons/svg/zip.svg | 2 +- src/icons/svgo.yml | 22 +++++++++++++++++++ .../dashboard/admin/components/PanelGroup.vue | 8 +++---- src/views/login/index.vue | 5 +---- src/views/login/socialsignin.vue | 6 ++--- 45 files changed, 72 insertions(+), 50 deletions(-) create mode 100644 src/icons/svg/guide 2.svg create mode 100644 src/icons/svg/shopping.svg delete mode 100644 src/icons/svg/shoppingCard.svg create mode 100644 src/icons/svg/tree.svg create mode 100644 src/icons/svgo.yml diff --git a/package.json b/package.json index fa81776..e7912d6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js", "lint": "eslint --ext .js,.vue src", "test": "npm run lint", - "precommit": "lint-staged" + "precommit": "lint-staged", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" }, "lint-staged": { "src/**/*.{js,vue}": [ @@ -105,6 +106,7 @@ "serve-static": "1.13.2", "shelljs": "0.8.2", "svg-sprite-loader": "3.8.0", + "svgo": "1.0.5", "uglifyjs-webpack-plugin": "1.2.7", "url-loader": "1.0.1", "vue-loader": "15.3.0", diff --git a/src/icons/svg/404.svg b/src/icons/svg/404.svg index bc5bc9f..6df5019 100644 --- a/src/icons/svg/404.svg +++ b/src/icons/svg/404.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg index a12a939..05a150d 100644 --- a/src/icons/svg/bug.svg +++ b/src/icons/svg/bug.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg index b1b3133..27728fb 100644 --- a/src/icons/svg/chart.svg +++ b/src/icons/svg/chart.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg index cf1c9b0..90923ff 100644 --- a/src/icons/svg/clipboard.svg +++ b/src/icons/svg/clipboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg index a8008c8..207ada3 100644 --- a/src/icons/svg/component.svg +++ b/src/icons/svg/component.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg index bee4250..5317d37 100644 --- a/src/icons/svg/dashboard.svg +++ b/src/icons/svg/dashboard.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg index 405c2ad..7043122 100644 --- a/src/icons/svg/documentation.svg +++ b/src/icons/svg/documentation.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg index 819c8d5..4185d3c 100644 --- a/src/icons/svg/drag.svg +++ b/src/icons/svg/drag.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg index 5c77d97..0306a86 100644 --- a/src/icons/svg/edit.svg +++ b/src/icons/svg/edit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg index 8a87e14..055e501 100644 --- a/src/icons/svg/email.svg +++ b/src/icons/svg/email.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg index 681422e..46f42b5 100644 --- a/src/icons/svg/example.svg +++ b/src/icons/svg/example.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg index e5dd5ce..59d54b2 100644 --- a/src/icons/svg/excel.svg +++ b/src/icons/svg/excel.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg index 194aa45..16ed2d8 100644 --- a/src/icons/svg/eye.svg +++ b/src/icons/svg/eye.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg index 79716f0..dcbaa18 100644 --- a/src/icons/svg/form.svg +++ b/src/icons/svg/form.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/guide 2.svg b/src/icons/svg/guide 2.svg new file mode 100644 index 0000000..d053bd7 --- /dev/null +++ b/src/icons/svg/guide 2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg index 9bae339..b271001 100644 --- a/src/icons/svg/guide.svg +++ b/src/icons/svg/guide.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg index 906af96..82be8ee 100644 --- a/src/icons/svg/icon.svg +++ b/src/icons/svg/icon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg index 6912767..e9b56ee 100644 --- a/src/icons/svg/international.svg +++ b/src/icons/svg/international.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg index 2baf743..96d0028 100644 --- a/src/icons/svg/language.svg +++ b/src/icons/svg/language.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg index 11037e6..0709014 100644 --- a/src/icons/svg/link.svg +++ b/src/icons/svg/link.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg index c45f459..20259ed 100644 --- a/src/icons/svg/list.svg +++ b/src/icons/svg/list.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg index 37c6070..74fee54 100644 --- a/src/icons/svg/lock.svg +++ b/src/icons/svg/lock.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg index d807b00..14ca817 100644 --- a/src/icons/svg/message.svg +++ b/src/icons/svg/message.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg index d4fcb9c..c1580de 100644 --- a/src/icons/svg/money.svg +++ b/src/icons/svg/money.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg index f564197..06713a8 100644 --- a/src/icons/svg/nested.svg +++ b/src/icons/svg/nested.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg index 920b500..e291d85 100644 --- a/src/icons/svg/password.svg +++ b/src/icons/svg/password.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg index 3985ab5..2bd54ae 100644 --- a/src/icons/svg/people.svg +++ b/src/icons/svg/people.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg index 2dccfcc..2c91161 100644 --- a/src/icons/svg/peoples.svg +++ b/src/icons/svg/peoples.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg index 97aee71..ee13d4e 100644 --- a/src/icons/svg/qq.svg +++ b/src/icons/svg/qq.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/src/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shoppingCard.svg b/src/icons/svg/shoppingCard.svg deleted file mode 100644 index cdebbdb..0000000 --- a/src/icons/svg/shoppingCard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg index def290f..ddb25b8 100644 --- a/src/icons/svg/size.svg +++ b/src/icons/svg/size.svg @@ -1,2 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg index 685a301..6cf86e6 100644 --- a/src/icons/svg/star.svg +++ b/src/icons/svg/star.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg index 17aa088..b4b48e4 100644 --- a/src/icons/svg/tab.svg +++ b/src/icons/svg/tab.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg index 083bc8c..dbfe5d6 100644 --- a/src/icons/svg/table.svg +++ b/src/icons/svg/table.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg index d5c2e5a..5982a2f 100644 --- a/src/icons/svg/theme.svg +++ b/src/icons/svg/theme.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg index 5971dee..0ba0716 100644 --- a/src/icons/svg/user.svg +++ b/src/icons/svg/user.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg index d88a64b..9e18b71 100644 --- a/src/icons/svg/wechat.svg +++ b/src/icons/svg/wechat.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg index e9a9d01..f806fc4 100644 --- a/src/icons/svg/zip.svg +++ b/src/icons/svg/zip.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/src/views/dashboard/admin/components/PanelGroup.vue b/src/views/dashboard/admin/components/PanelGroup.vue index 2d1d58c..8125b84 100644 --- a/src/views/dashboard/admin/components/PanelGroup.vue +++ b/src/views/dashboard/admin/components/PanelGroup.vue @@ -35,8 +35,8 @@
-
- +
+
Shoppings
@@ -91,7 +91,7 @@ export default { .icon-money { background: #f4516c; } - .icon-shoppingCard { + .icon-shopping { background: #34bfa3 } } @@ -104,7 +104,7 @@ export default { .icon-money { color: #f4516c; } - .icon-shoppingCard { + .icon-shopping { color: #34bfa3 } .card-panel-icon-wrapper { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 163be6d..d25b519 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -9,7 +9,7 @@
-