diff --git a/src/components/Icon-svg/index.vue b/src/components/SvgIcon/index.vue similarity index 95% rename from src/components/Icon-svg/index.vue rename to src/components/SvgIcon/index.vue index 3e77146ee7dd5a184ca28e7d63d7afcb5f10a454..b8f3219d17fbbf4296de34b648e5459cb4681934 100644 --- a/src/components/Icon-svg/index.vue +++ b/src/components/SvgIcon/index.vue @@ -6,7 +6,7 @@ <script> export default { - name: 'icon-svg', + name: 'svg-icon', props: { iconClass: { type: String, diff --git a/src/icons/index.js b/src/icons/index.js index c8e36b9bab72c9ecb8752b04b2be42a39e24d6b2..e66c6ea17b9614b4340f03fa38e30540b30224dc 100644 --- a/src/icons/index.js +++ b/src/icons/index.js @@ -1,9 +1,9 @@ import Vue from 'vue' -import IconSvg from '@/components/Icon-svg'// svg组件 +import SvgIcon from '@/components/SvgIcon'// svg组件 import generateIconsView from '@/views/svg-icons/generateIconsView.js'// just for views/icons , you can delete it // register globally -Vue.component('icon-svg', IconSvg) +Vue.component('svg-icon', SvgIcon) const requireAll = requireContext => requireContext.keys().map(requireContext) const req = require.context('./svg', false, /\.svg$/) diff --git a/src/views/dashboard/admin/index.vue b/src/views/dashboard/admin/index.vue index 528089424b72846a81490688d7619a0b9b55a3ff..8f2eb5c570de65427994e547bb646ed2558842d9 100644 --- a/src/views/dashboard/admin/index.vue +++ b/src/views/dashboard/admin/index.vue @@ -34,12 +34,12 @@ <div class="info-item"> <count-to class="info-item-num" :startVal='0' :endVal='statisticsData.article_count' :duration='3400'></count-to> <span class="info-item-text">æ–‡ç« </span> - <icon-svg icon-class="trendChart1" class="dashboard-editor-icon"></icon-svg> + <svg-icon icon-class="trendChart1" class="dashboard-editor-icon"></svg-icon> </div> <div class="info-item"> <count-to class="info-item-num" :startVal='0' :endVal='statisticsData.pageviews_count' :duration='3600'></count-to> <span class="info-item-text">æµè§ˆé‡</span> - <icon-svg icon-class="trendChart2" class="dashboard-editor-icon"></icon-svg> + <svg-icon icon-class="trendChart2" class="dashboard-editor-icon"></svg-icon> </div> </el-card> </el-col> diff --git a/src/views/example/tab/components/tabPane.vue b/src/views/example/tab/components/tabPane.vue index efb29471409d40d370a6f2e715c00046e0b00d75..536c0092a0312b4bd80163972ee1b089aba42061 100644 --- a/src/views/example/tab/components/tabPane.vue +++ b/src/views/example/tab/components/tabPane.vue @@ -29,7 +29,7 @@ <el-table-column width="80px" label="é‡è¦æ€§"> <template scope="scope"> - <icon-svg v-for="n in +scope.row.importance" icon-class="star" :key="n"></icon-svg> + <svg-icon v-for="n in +scope.row.importance" icon-class="star" :key="n"></svg-icon> </template> </el-table-column> diff --git a/src/views/example/table/dragTable.vue b/src/views/example/table/dragTable.vue index 64886f60e9aab3b122655252202b522c41a0ee79..e1bc0da990612858a11574b7bd4825692c531e59 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"> - <icon-svg v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></icon-svg> + <svg-icon v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></svg-icon> </template> </el-table-column> @@ -47,7 +47,7 @@ <el-table-column align="center" label="拖拽" width="95"> <template scope="scope"> - <icon-svg class='drag-handler' icon-class="drag"></icon-svg> + <svg-icon class='drag-handler' icon-class="drag"></svg-icon> </template> </el-table-column> diff --git a/src/views/example/table/inlineEditTable.vue b/src/views/example/table/inlineEditTable.vue index dfd53cc12652741514257f49a4081128625581cb..d8f0c40df0694f88538ad18384d24424802c7ad7 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"> - <icon-svg v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></icon-svg> + <svg-icon v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></svg-icon> </template> </el-table-column> diff --git a/src/views/example/table/table.vue b/src/views/example/table/table.vue index 276c68e46b6dbcd7022409255698c11cde5e7e89..496bfefd392b41fde6c93df6acf73933b5219f94 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"> - <icon-svg v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></icon-svg> + <svg-icon v-for="n in +scope.row.importance" icon-class="star" class="meta-item__icon" :key="n"></svg-icon> </template> </el-table-column> diff --git a/src/views/layout/components/SidebarItem.vue b/src/views/layout/components/SidebarItem.vue index a1eb781ea0712d7b0e0810f7b6c64936add93ed6..63bdf44e2e61476514da8f227405013467d4f058 100644 --- a/src/views/layout/components/SidebarItem.vue +++ b/src/views/layout/components/SidebarItem.vue @@ -4,13 +4,13 @@ <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" class='submenu-title-noDropdown'> - <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.children[0].name}}</span> + <svg-icon v-if='item.icon' :icon-class="item.icon"></svg-icon><span>{{item.children[0].name}}</span> </el-menu-item> </router-link> <el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden"> <template slot="title"> - <icon-svg v-if='item.icon' :icon-class="item.icon"></icon-svg><span>{{item.name}}</span> + <svg-icon v-if='item.icon' :icon-class="item.icon"></svg-icon><span>{{item.name}}</span> </template> <template v-for="child in item.children" v-if='!child.hidden'> @@ -18,7 +18,7 @@ <router-link v-else :to="item.path+'/'+child.path"> <el-menu-item :index="item.path+'/'+child.path"> - <icon-svg v-if='child.icon' :icon-class="child.icon"></icon-svg><span>{{child.name}}</span> + <svg-icon v-if='child.icon' :icon-class="child.icon"></svg-icon><span>{{child.name}}</span> </el-menu-item> </router-link> diff --git a/src/views/login/index.vue b/src/views/login/index.vue index b4923042ba30d8cb9d251c59a3c116bd988ad864..798de9a1cc11d744e68e44b01b7ad2e424587d6e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -5,18 +5,18 @@ <el-form-item prop="username"> <span class="svg-container svg-container_login"> - <icon-svg icon-class="user" /> + <svg-icon icon-class="user" /> </span> <el-input name="username" type="text" v-model="loginForm.username" autoComplete="on" placeholder="邮箱" /> </el-form-item> <el-form-item prop="password"> <span class="svg-container"> - <icon-svg icon-class="password" /> + <svg-icon icon-class="password" /> </span> <el-input name="password" :type="pwdType" @keyup.enter.native="handleLogin" v-model="loginForm.password" autoComplete="on" placeholder="密ç " /> - <span class='show-pwd' @click='showPwd'><icon-svg icon-class="eye" /></span> + <span class='show-pwd' @click='showPwd'><svg-icon icon-class="eye" /></span> </el-form-item> <el-button type="primary" style="width:100%;margin-bottom:30px;" :loading="loading" @click.native.prevent="handleLogin">登录</el-button> diff --git a/src/views/login/socialsignin.vue b/src/views/login/socialsignin.vue index 70d309173610ad3b4fc38375f757fa9151fd78f4..bdd111203a6054b7a2fb1418bd6cda6b7f427d79 100644 --- a/src/views/login/socialsignin.vue +++ b/src/views/login/socialsignin.vue @@ -1,10 +1,10 @@ <template> <div class="social-signup-container"> <div class="sign-btn" @click="wechatHandleClick('wechat')"> - <span class="wx-svg-container"><icon-svg icon-class="wechat" class="icon"></icon-svg></span> 微信 + <span class="wx-svg-container"><svg-icon icon-class="wechat" class="icon"></svg-icon></span> 微信 </div> <div class="sign-btn" @click="tencentHandleClick('tencent')"> - <span class="qq-svg-container"><icon-svg icon-class="qq" class="icon"></icon-svg></span> QQ + <span class="qq-svg-container"><svg-icon icon-class="qq" class="icon"></svg-icon></span> QQ </div> </div> </template> diff --git a/src/views/svg-icons/index.vue b/src/views/svg-icons/index.vue index 71da22c75b0a8f41eb98a3b5307dc5ca0575899a..50647f7ecd02cae8f1102eb334357f473dbe0623 100644 --- a/src/views/svg-icons/index.vue +++ b/src/views/svg-icons/index.vue @@ -6,7 +6,7 @@ <div slot="content"> {{generateIconCode(item)}} </div> - <icon-svg :icon-class="item" /> + <svg-icon :icon-class="item" /> </el-tooltip> <span>{{item}}</span> </div> @@ -32,7 +32,7 @@ export default { }, methods: { generateIconCode(symbol) { - return `<icon-svg :icon-class="${symbol}" />` + return `<svg-icon :icon-class="${symbol}" />` }, handleClipboard(text, event) { clipboard(text, event)