From 622a8c3a69ecc35aeaad84ce099397b59c5d0c29 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 5 Jul 2017 11:42:29 +0800 Subject: [PATCH] refine icon-svg --- src/components/Icon-svg/index.js | 11 ---- .../Icon-svg/{wscn-icon-svg.vue => index.vue} | 8 +-- src/components/Icon-svg/wscn-icon-stack.vue | 52 ------------------ src/main.js | 4 +- src/styles/index.scss | 2 +- src/views/dashboard/editor/index.vue | 8 ++- src/views/example/tab/components/tabPane.vue | 2 +- src/views/example/table/dragTable.vue | 4 +- src/views/example/table/inlineEditTable.vue | 2 +- src/views/example/table/table.vue | 2 +- src/views/layout/SidebarItem.vue | 6 +-- src/views/login/index.vue | 54 +++++++++---------- src/views/login/socialsignin.vue | 6 +-- 13 files changed, 45 insertions(+), 116 deletions(-) delete mode 100644 src/components/Icon-svg/index.js rename src/components/Icon-svg/{wscn-icon-svg.vue => index.vue} (72%) delete mode 100644 src/components/Icon-svg/wscn-icon-stack.vue diff --git a/src/components/Icon-svg/index.js b/src/components/Icon-svg/index.js deleted file mode 100644 index 55d342a9..00000000 --- a/src/components/Icon-svg/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import Vue from 'vue' - -function registerAllComponents(requireContext) { - return requireContext.keys().forEach(comp => { - const vueComp = requireContext(comp) - const compName = vueComp.name ? vueComp.name.toLowerCase() : /\/([\w-]+)\.vue$/.exec(comp)[1] - Vue.component(compName, vueComp) - }) -} - -registerAllComponents(require.context('./', false, /\.vue$/)) diff --git a/src/components/Icon-svg/wscn-icon-svg.vue b/src/components/Icon-svg/index.vue similarity index 72% rename from src/components/Icon-svg/wscn-icon-svg.vue rename to src/components/Icon-svg/index.vue index 04b01f4a..44881b1a 100644 --- a/src/components/Icon-svg/wscn-icon-svg.vue +++ b/src/components/Icon-svg/index.vue @@ -1,12 +1,12 @@ - - diff --git a/src/components/Icon-svg/wscn-icon-stack.vue b/src/components/Icon-svg/wscn-icon-stack.vue deleted file mode 100644 index bf7b07e1..00000000 --- a/src/components/Icon-svg/wscn-icon-stack.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/src/main.js b/src/main.js index 4104e1f2..cd00bfc9 100644 --- a/src/main.js +++ b/src/main.js @@ -10,19 +10,21 @@ import 'assets/custom-theme/index.css'; // 换肤版本element-ui css import NProgress from 'nprogress'; // Progress 进度条 import 'nprogress/nprogress.css';// Progress 进度条 样式 import 'normalize.css/normalize.css';// normalize.css 样式格式化 -import 'components/Icon-svg/index'; // 封装的svg组件 import 'assets/iconfont/iconfont'; // iconfont 具体图标见https://github.com/PanJiaChen/vue-element-admin/wiki import * as filters from './filters'; // 全局vue filter import Multiselect from 'vue-multiselect';// 使用的一个多选框组件,element-ui的select不能满足所有需求 import 'vue-multiselect/dist/vue-multiselect.min.css';// 多选框组件css import Sticky from 'components/Sticky'; // 粘性header组件 +import IconSvg from 'components/Icon-svg';// svg 组件 import vueWaves from './directive/waves';// 水波纹指令 import errLog from 'store/errLog';// error log组件 import './mock/index.js'; // 该项目所有请求使用mockjs模拟 + // register globally Vue.component('multiselect', Multiselect); Vue.component('Sticky', Sticky); +Vue.component('icon-svg', IconSvg) Vue.use(ElementUI); Vue.use(vueWaves); diff --git a/src/styles/index.scss b/src/styles/index.scss index 79fda7e9..97b1a62b 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -116,7 +116,7 @@ code { .text-center{ text-align: center } -.wscn-icon { +.svg-icon { width: 1em; height: 1em; vertical-align: -0.15em; diff --git a/src/views/dashboard/editor/index.vue b/src/views/dashboard/editor/index.vue index 0da5231f..b4df574c 100644 --- a/src/views/dashboard/editor/index.vue +++ b/src/views/dashboard/editor/index.vue @@ -1,6 +1,5 @@