Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
Support
提交反馈
为 GitLab 提交贡献
登录
切换导航
兵
兵役_吉林工业
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
麦嘉得
兵役_吉林工业
提交
dcd3e316
提交
dcd3e316
编写于
11月 24, 2017
作者:
Pan
提交者:
花裤衩
11月 29, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:refine SvgIcon
上级
e431fa97
变更
6
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
48 行增加
和
37 行删除
+48
-37
index.vue
src/components/Icon-svg/index.vue
+0
-22
index.vue
src/components/SvgIcon/index.vue
+42
-0
index.js
src/icons/index.js
+2
-2
index.scss
src/styles/index.scss
+0
-9
SidebarItem.vue
src/views/layout/components/Sidebar/SidebarItem.vue
+2
-2
index.vue
src/views/login/index.vue
+2
-2
未找到文件。
src/components/Icon-svg/index.vue
已删除
100644 → 0
浏览文件 @
e431fa97
<
template
>
<svg
class=
"svg-icon"
aria-hidden=
"true"
>
<use
:xlink:href=
"iconName"
></use>
</svg>
</
template
>
<
script
>
export
default
{
name
:
'
icon-svg
'
,
props
:
{
iconClass
:
{
type
:
String
,
required
:
true
}
},
computed
:
{
iconName
()
{
return
`#icon-
${
this
.
iconClass
}
`
}
}
}
</
script
>
src/components/SvgIcon/index.vue
0 → 100644
浏览文件 @
dcd3e316
<
template
>
<svg
:class=
"svgClass"
aria-hidden=
"true"
>
<use
:xlink:href=
"iconName"
></use>
</svg>
</
template
>
<
script
>
export
default
{
name
:
'
svg-icon
'
,
props
:
{
iconClass
:
{
type
:
String
,
required
:
true
},
className
:
{
type
:
String
}
},
computed
:
{
iconName
()
{
return
`#icon-
${
this
.
iconClass
}
`
},
svgClass
()
{
if
(
this
.
className
)
{
return
'
svg-icon
'
+
this
.
className
}
else
{
return
'
svg-icon
'
}
}
}
}
</
script
>
<
style
scoped
>
.svg-icon
{
width
:
1em
;
height
:
1em
;
vertical-align
:
-0.15em
;
fill
:
currentColor
;
overflow
:
hidden
;
}
</
style
>
src/icons/index.js
浏览文件 @
dcd3e316
import
Vue
from
'
vue
'
import
IconSvg
from
'
@/components/Icon-svg
'
// svg组件
import
SvgIcon
from
'
@/components/SvgIcon
'
// svg组件
// 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$/
)
...
...
src/styles/index.scss
浏览文件 @
dcd3e316
...
...
@@ -55,12 +55,3 @@ a:hover {
.app-container
{
padding
:
20px
;
}
.svg-icon
{
width
:
1em
;
height
:
1em
;
vertical-align
:
-0
.15em
;
fill
:
currentColor
;
overflow
:
hidden
;
}
src/views/layout/components/Sidebar/SidebarItem.vue
浏览文件 @
dcd3e316
...
...
@@ -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"
>
<
icon-svg
v-if=
'item.icon'
:icon-class=
"item.icon"
/>
{{
item
.
children
[
0
].
name
}}
<
svg-icon
v-if=
'item.icon'
:icon-class=
"item.icon"
/>
{{
item
.
children
[
0
].
name
}}
</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"
/>
{{
item
.
name
}}
<
svg-icon
v-if=
'item.icon'
:icon-class=
"item.icon"
/>
{{
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>
...
...
src/views/login/index.vue
浏览文件 @
dcd3e316
...
...
@@ -5,13 +5,13 @@
<h3
class=
"title"
>
vue-element-admin
</h3>
<el-form-item
prop=
"username"
>
<span
class=
"svg-container svg-container_login"
>
<
icon-svg
icon-class=
"yonghuming"
/>
<
svg-icon
icon-class=
"yonghuming"
/>
</span>
<el-input
name=
"username"
type=
"text"
v-model=
"loginForm.username"
autoComplete=
"on"
placeholder=
"username"
/>
</el-form-item>
<el-form-item
prop=
"password"
>
<span
class=
"svg-container"
>
<
icon-svg
icon-class=
"mima"
></icon-svg
>
<
svg-icon
icon-class=
"mima"
></svg-icon
>
</span>
<el-input
name=
"password"
type=
"password"
@
keyup.enter.native=
"handleLogin"
v-model=
"loginForm.password"
autoComplete=
"on"
placeholder=
"password"
></el-input>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录