diff --git a/src/components/Icon-svg/index.js b/src/components/Icon-svg/index.js deleted file mode 100644 index 55d342a943f248d98a4b08af2805fe588cfcdf59..0000000000000000000000000000000000000000 --- 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 04b01f4aff873d3010b83d9925061c76948ae98b..44881b1a88dfd3a90e7af853c2317482c92948ba 100644 --- a/src/components/Icon-svg/wscn-icon-svg.vue +++ b/src/components/Icon-svg/index.vue @@ -1,12 +1,12 @@ <template> - <svg class="wscn-icon" aria-hidden="true"> + <svg class="svg-icon" aria-hidden="true"> <use :xlink:href="iconName"></use> </svg> </template> <script> export default { - name: 'wscn-icon-svg', + name: 'icon-svg', props: { iconClass: { type: String, @@ -20,7 +20,3 @@ } } </script> - -<style lang="scss" scoped> - -</style> 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 bf7b07e125eb355ac01ffbcd61cd96c04ac1d02d..0000000000000000000000000000000000000000 --- a/src/components/Icon-svg/wscn-icon-stack.vue +++ /dev/null @@ -1,52 +0,0 @@ -<template> - <div class="icon-container" :style="containerStyle"> - <slot class="icon"></slot> - </div> -</template> - -<script> - export default { - name: 'wscn-icon-stack', - props: { - width: { - type: Number, - default: 20 - }, - shape: { - type: String, - default: 'circle', - validator: val => { - const validShapes = ['circle', 'square'] - return validShapes.indexOf(val) > -1 - } - } - }, - computed: { - containerStyle() { - return { - width: `${this.width}px`, - height: `${this.width}px`, - fontSize: `${this.width * 0.6}px`, - borderRadius: `${this.shape === 'circle' && '50%'}` - } - } - } - } -</script> - -<style lang="scss" scoped> - .icon-container { - display: inline-block; - position: relative; - overflow: hidden; - background: #1482F0; - - .icon { - position: absolute; - color: #ffffff; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } -</style> diff --git a/src/main.js b/src/main.js index 4104e1f2ede0c9e1ed34d143f22151ec9797bb91..cd00bfc9e0d19edbd9a9f4dc39abfdc816bf5bde 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 79fda7e9cd7d0cb6ed178b97ae0b042a2d29f64d..97b1a62bede683f11aaaad78d8d20f82ffdf8f0e 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 0da5231f820947639c98821eeee5ea997e53b614..b4df574cfd8f54206e1a9546669bc6caa7449edb 100644 --- a/src/views/dashboard/editor/index.vue +++ b/src/views/dashboard/editor/index.vue @@ -1,6 +1,5 @@ <template> <div class="dashboard-editor-container"> - <a href="https://github.com/PanJiaChen/vue-element-admin" target="_blank" class="github-corner" aria-label="View source on Github"> <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4AB7BD; color:#fff; position: absolute; top: 50px; border: 0; right: 0;" aria-hidden="true"> @@ -11,7 +10,6 @@ fill="currentColor" class="octo-body"></path> </svg> </a> - <el-row class="btn-group"> <el-col :span="4" class='text-center'> <router-link class="pan-btn blue-btn" to="/components/index">Components</router-link> @@ -38,19 +36,19 @@ <el-card class="box-card"> <div slot="header" class="box-card-header"> <pan-thumb class="panThumb" :image="avatar"> ä½ çš„æƒé™: - <span class="pan-info-roles" v-for="item in roles">{{item}}</span> + <span class="pan-info-roles" :key='item' v-for="item in roles">{{item}}</span> </pan-thumb> </div> <span class="display_name">{{name}}</span> <div class="info-item"> <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></countTo> <span class="info-item-text">æ–‡ç« </span> - <wscn-icon-svg icon-class="a" class="dashboard-editor-icon" /> + <icon-svg icon-class="a" class="dashboard-editor-icon"></icon-svg> </div> <div class="info-item"> <countTo class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></countTo> <span class="info-item-text">æµè§ˆé‡</span> - <wscn-icon-svg icon-class="b" class="dashboard-editor-icon" /> + <icon-svg icon-class="b" class="dashboard-editor-icon"></icon-svg> </div> </el-card> </el-col> diff --git a/src/views/example/tab/components/tabPane.vue b/src/views/example/tab/components/tabPane.vue index 1a318c36f490321c1885a809296e3019d46921a9..7029f56c3e349a7919023285129f547a12468a26 100644 --- a/src/views/example/tab/components/tabPane.vue +++ b/src/views/example/tab/components/tabPane.vue @@ -28,7 +28,7 @@ <el-table-column width="80px" label="é‡è¦æ€§"> <template scope="scope"> - <wscn-icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" /> + <icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n"></icon-svg> </template> </el-table-column> diff --git a/src/views/example/table/dragTable.vue b/src/views/example/table/dragTable.vue index 512c8a250e77cdfcbecabbd074ab92fdc21b8326..7686446f8f7e11c8c55d21fddd5c2cd65798a89f 100644 --- a/src/views/example/table/dragTable.vue +++ b/src/views/example/table/dragTable.vue @@ -29,7 +29,7 @@ <el-table-column width="80px" label="é‡è¦æ€§"> <template scope="scope"> - <wscn-icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" /> + <icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n"></icon-svg> </template> </el-table-column> @@ -47,7 +47,7 @@ <el-table-column align="center" label="拖拽" width="95"> <template scope="scope"> - <wscn-icon-svg class='drag-handler' icon-class="tuozhuai" /> + <icon-svg class='drag-handler' icon-class="tuozhuai" ></icon-svg> </template> </el-table-column> diff --git a/src/views/example/table/inlineEditTable.vue b/src/views/example/table/inlineEditTable.vue index d9bd0dd73a523ef25658dd7a4a7e21c7983b5da3..60fcb8b98009d5a592194eff3c0e2fec4552f02a 100644 --- a/src/views/example/table/inlineEditTable.vue +++ b/src/views/example/table/inlineEditTable.vue @@ -23,7 +23,7 @@ <el-table-column width="100px" label="é‡è¦æ€§"> <template scope="scope"> - <wscn-icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" /> + <icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" ></icon-svg> </template> </el-table-column> diff --git a/src/views/example/table/table.vue b/src/views/example/table/table.vue index 08a10c29725b4ea20bb6e90a455126d2af1e0399..bc5181f072fcc92e2e264e85082b2355a66fcf95 100644 --- a/src/views/example/table/table.vue +++ b/src/views/example/table/table.vue @@ -60,7 +60,7 @@ <el-table-column width="80px" label="é‡è¦æ€§"> <template scope="scope"> - <wscn-icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" /> + <icon-svg v-for="n in +scope.row.importance" icon-class="wujiaoxing" class="meta-item__icon" :key="n" ></icon-svg> </template> </el-table-column> diff --git a/src/views/layout/SidebarItem.vue b/src/views/layout/SidebarItem.vue index 9a293fffc4c4c7ab989d38724209972a5fd3242a..1d31d1ff605107254971767634ebfd9e0ab3ec84 100644 --- a/src/views/layout/SidebarItem.vue +++ b/src/views/layout/SidebarItem.vue @@ -3,12 +3,12 @@ <template v-for="item in routes"> <router-link v-if="!item.hidden&&item.noDropdown&&item.children.length>0" :to="item.path+'/'+item.children[0].path"> <el-menu-item :index="item.path+'/'+item.children[0].path"> - <wscn-icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.children[0].name}} + <icon-svg v-if='item.icon' :icon-class="item.icon" ></icon-svg>{{item.children[0].name}} </el-menu-item> </router-link> <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden"> <template slot="title"> - <wscn-icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.name}} + <icon-svg v-if='item.icon' :icon-class="item.icon" ></icon-svg> {{item.name}} </template> <template v-for="child in item.children" v-if='!child.hidden'> <sidebar-item class='menu-indent' v-if='child.children&&child.children.length>0' :routes='[child]'> </sidebar-item> @@ -36,7 +36,7 @@ </script> <style rel="stylesheet/scss" lang="scss" scoped> - .wscn-icon { + .svg-icon { margin-right: 10px; } .hideSidebar .menu-indent{ diff --git a/src/views/login/index.vue b/src/views/login/index.vue index faaae648501d6a7507042870b8bbefed2205869d..4207dddf5253dc9d6fc3d512ec5b149a8b72d8ef 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,32 +1,30 @@ <template> - <div class="login-container"> - <el-form autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginForm" label-position="left" - label-width="0px" - class="card-box login-form"> - <h3 class="title">系统登录</h3> - <el-form-item prop="email"> - <span class="svg-container"><wscn-icon-svg icon-class="jiedianyoujian"/></span> - <el-input name="email" type="text" v-model="loginForm.email" autoComplete="on" - placeholder="邮箱"></el-input> - </el-form-item> - <el-form-item prop="password"> - <span class="svg-container"><wscn-icon-svg icon-class="mima"/></span> - <el-input name="password" type="password" @keyup.enter.native="handleLogin" v-model="loginForm.password" - autoComplete="on" placeholder="密ç "></el-input> - </el-form-item> - <el-form-item> - <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin"> - 登录 - </el-button> - </el-form-item> - <div class='tips'>adminè´¦å·ä¸º:admin@wallstreetcn.com 密ç éšä¾¿å¡«</div> - <div class='tips'>editorè´¦å·:editor@wallstreetcn.com 密ç éšä¾¿å¡«</div> - </el-form> - <el-dialog title="第三方验è¯" :visible.sync="showDialog"> - 邮箱登录æˆåŠŸ,è¯·é€‰æ‹©ç¬¬ä¸‰æ–¹éªŒè¯ - <socialSign></socialSign> - </el-dialog> - </div> + <div class="login-container"> + <el-form autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginForm" label-position="left" label-width="0px" + class="card-box login-form"> + <h3 class="title">系统登录</h3> + <el-form-item prop="email"> + <span class="svg-container"><icon-svg icon-class="jiedianyoujian"></icon-svg></span> + <el-input name="email" type="text" v-model="loginForm.email" autoComplete="on" placeholder="邮箱"></el-input> + </el-form-item> + <el-form-item prop="password"> + <span class="svg-container"><icon-svg icon-class="mima"></icon-svg></span> + <el-input name="password" type="password" @keyup.enter.native="handleLogin" v-model="loginForm.password" autoComplete="on" + placeholder="密ç "></el-input> + </el-form-item> + <el-form-item> + <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleLogin"> + 登录 + </el-button> + </el-form-item> + <div class='tips'>adminè´¦å·ä¸º:admin@wallstreetcn.com 密ç éšä¾¿å¡«</div> + <div class='tips'>editorè´¦å·:editor@wallstreetcn.com 密ç éšä¾¿å¡«</div> + </el-form> + <el-dialog title="第三方验è¯" :visible.sync="showDialog"> + 邮箱登录æˆåŠŸ,è¯·é€‰æ‹©ç¬¬ä¸‰æ–¹éªŒè¯ + <socialSign></socialSign> + </el-dialog> + </div> </template> <script> diff --git a/src/views/login/socialsignin.vue b/src/views/login/socialsignin.vue index 1bdf9c8d258e812477ab6f560a458505c40400f8..4b4f9e33998dfeb59d085e43285737f685c48254 100644 --- a/src/views/login/socialsignin.vue +++ b/src/views/login/socialsignin.vue @@ -1,12 +1,10 @@ <template> <div class="social-signup-container"> <div class="sign-btn" @click="wechatHandleClick('wechat')"> - <span class="wx-svg-container"><wscn-icon-svg icon-class="weixin" class="icon"/></span> - 微信 + <span class="wx-svg-container"><icon-svg icon-class="weixin" class="icon"></icon-svg></span> 微信 </div> <div class="sign-btn" @click="tencentHandleClick('tencent')"> - <span class="qq-svg-container"><wscn-icon-svg icon-class="QQ" class="icon"/></span> - QQ + <span class="qq-svg-container"><icon-svg icon-class="QQ" class="icon"></icon-svg></span> QQ </div> </div> </template>