Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
InJoyU
vue-element-admin
提交
0fbda3c8
V
vue-element-admin
项目概览
InJoyU
/
vue-element-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0fbda3c8
编写于
8月 29, 2018
作者:
花
花裤衩
提交者:
GitHub
8月 29, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: add global size option (#1024)
上级
5bbb4abe
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
112 addition
and
6 deletion
+112
-6
src/components/LangSelect/index.vue
src/components/LangSelect/index.vue
+1
-1
src/components/SizeSelect/index.vue
src/components/SizeSelect/index.vue
+63
-0
src/icons/svg/size.svg
src/icons/svg/size.svg
+2
-0
src/lang/en.js
src/lang/en.js
+3
-2
src/lang/zh.js
src/lang/zh.js
+2
-1
src/main.js
src/main.js
+3
-1
src/router/index.js
src/router/index.js
+11
-0
src/store/getters.js
src/store/getters.js
+1
-0
src/store/modules/app.js
src/store/modules/app.js
+9
-1
src/views/layout/components/Navbar.vue
src/views/layout/components/Navbar.vue
+6
-0
src/views/redirect/index.vue
src/views/redirect/index.vue
+11
-0
未找到文件。
src/components/LangSelect/index.vue
浏览文件 @
0fbda3c8
...
...
@@ -22,7 +22,7 @@ export default {
this
.
$i18n
.
locale
=
lang
this
.
$store
.
dispatch
(
'
setLanguage
'
,
lang
)
this
.
$message
({
message
:
'
switch language s
uccess
'
,
message
:
'
Switch Language S
uccess
'
,
type
:
'
success
'
})
}
...
...
src/components/SizeSelect/index.vue
0 → 100644
浏览文件 @
0fbda3c8
<
template
>
<el-dropdown
trigger=
"click"
@
command=
"handleSetSize"
>
<div>
<svg-icon
class-name=
"size-icon"
icon-class=
"size"
/>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:disabled=
"size==='medium'"
command=
"medium"
>
Medium
</el-dropdown-item>
<el-dropdown-item
:disabled=
"size==='small'"
command=
"small"
>
Small
</el-dropdown-item>
<el-dropdown-item
:disabled=
"size==='mini'"
command=
"mini"
>
Mini
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
<
script
>
export
default
{
computed
:
{
size
()
{
return
this
.
$store
.
getters
.
size
}
},
methods
:
{
handleSetSize
(
size
)
{
this
.
$ELEMENT
.
size
=
size
this
.
$store
.
dispatch
(
'
setSize
'
,
size
)
this
.
refreshView
()
this
.
$message
({
message
:
'
Switch Size Success
'
,
type
:
'
success
'
})
},
refreshView
()
{
// In order to make the cached page re-rendered
const
visitedViews
=
[...
this
.
$store
.
getters
.
visitedViews
].
map
(
i
=>
{
i
.
meta
.
noCache
=
true
return
i
})
this
.
$store
.
dispatch
(
'
delAllViews
'
,
this
.
$route
).
then
(()
=>
{
console
.
log
(
visitedViews
)
for
(
const
i
of
visitedViews
)
{
this
.
$store
.
dispatch
(
'
addVisitedViews
'
,
i
)
}
})
const
{
path
}
=
this
.
$route
this
.
$router
.
replace
({
path
:
'
/redirect
'
+
path
})
}
}
}
</
script
>
<
style
scoped
>
.size-icon
{
font-size
:
20px
;
cursor
:
pointer
;
vertical-align
:
-4px
!important
;
}
</
style
>
src/icons/svg/size.svg
0 → 100644
浏览文件 @
0fbda3c8
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
t=
"1535513021233"
class=
"icon"
style=
""
viewBox=
"0 0 1024 1024"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
p-id=
"13539"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
width=
"200"
height=
"200"
><defs><style
type=
"text/css"
>
@font-face { font-family: rbicon; src: url("chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/fonts/rbicon.woff2") format("woff2"); font-weight: normal; font-style: normal; }
</style></defs><path
d=
"M64 512l384 0 0 128-128 0 0 384-128 0 0-384-128 0zM960 256l-251.74016 0 0 768-136.4992 0 0-768-251.74016 0 0-128 640 0z"
p-id=
"13540"
></path></svg>
\ No newline at end of file
src/lang/en.js
浏览文件 @
0fbda3c8
...
...
@@ -67,8 +67,9 @@ export default {
logOut
:
'
Log Out
'
,
dashboard
:
'
Dashboard
'
,
github
:
'
Github
'
,
screenfull
:
'
screenfull
'
,
theme
:
'
theme
'
screenfull
:
'
Screenfull
'
,
theme
:
'
Theme
'
,
size
:
'
Global Size
'
},
login
:
{
title
:
'
Login Form
'
,
...
...
src/lang/zh.js
浏览文件 @
0fbda3c8
...
...
@@ -68,7 +68,8 @@ export default {
dashboard
:
'
首页
'
,
github
:
'
项目地址
'
,
screenfull
:
'
全屏
'
,
theme
:
'
换肤
'
theme
:
'
换肤
'
,
size
:
'
布局大小
'
},
login
:
{
title
:
'
系统登录
'
,
...
...
src/main.js
浏览文件 @
0fbda3c8
import
Vue
from
'
vue
'
import
Cookies
from
'
js-cookie
'
import
'
normalize.css/normalize.css
'
// A modern alternative to CSS resets
import
Element
from
'
element-ui
'
...
...
@@ -20,7 +22,7 @@ import './mock' // simulation data
import
*
as
filters
from
'
./filters
'
// global filters
Vue
.
use
(
Element
,
{
size
:
'
medium
'
,
// set element-ui default size
size
:
Cookies
.
get
(
'
size
'
)
||
'
medium
'
,
// set element-ui default size
i18n
:
(
key
,
value
)
=>
i18n
.
t
(
key
,
value
)
})
...
...
src/router/index.js
浏览文件 @
0fbda3c8
...
...
@@ -31,6 +31,17 @@ import nestedRouter from './modules/nested'
}
**/
export
const
constantRouterMap
=
[
{
path
:
'
/redirect
'
,
component
:
Layout
,
hidden
:
true
,
children
:
[
{
path
:
'
/redirect/:path*
'
,
component
:
()
=>
import
(
'
@/views/redirect/index
'
)
}
]
},
{
path
:
'
/login
'
,
component
:
()
=>
import
(
'
@/views/login/index
'
),
...
...
src/store/getters.js
浏览文件 @
0fbda3c8
const
getters
=
{
sidebar
:
state
=>
state
.
app
.
sidebar
,
language
:
state
=>
state
.
app
.
language
,
size
:
state
=>
state
.
app
.
size
,
device
:
state
=>
state
.
app
.
device
,
visitedViews
:
state
=>
state
.
tagsView
.
visitedViews
,
cachedViews
:
state
=>
state
.
tagsView
.
cachedViews
,
...
...
src/store/modules/app.js
浏览文件 @
0fbda3c8
...
...
@@ -7,7 +7,8 @@ const app = {
withoutAnimation
:
false
},
device
:
'
desktop
'
,
language
:
Cookies
.
get
(
'
language
'
)
||
'
en
'
language
:
Cookies
.
get
(
'
language
'
)
||
'
en
'
,
size
:
Cookies
.
get
(
'
size
'
)
||
'
medium
'
},
mutations
:
{
TOGGLE_SIDEBAR
:
state
=>
{
...
...
@@ -30,6 +31,10 @@ const app = {
SET_LANGUAGE
:
(
state
,
language
)
=>
{
state
.
language
=
language
Cookies
.
set
(
'
language
'
,
language
)
},
SET_SIZE
:
(
state
,
size
)
=>
{
state
.
size
=
size
Cookies
.
set
(
'
size
'
,
size
)
}
},
actions
:
{
...
...
@@ -44,6 +49,9 @@ const app = {
},
setLanguage
({
commit
},
language
)
{
commit
(
'
SET_LANGUAGE
'
,
language
)
},
setSize
({
commit
},
size
)
{
commit
(
'
SET_SIZE
'
,
size
)
}
}
}
...
...
src/views/layout/components/Navbar.vue
浏览文件 @
0fbda3c8
...
...
@@ -11,6 +11,10 @@
<screenfull
class=
"screenfull right-menu-item"
/>
</el-tooltip>
<el-tooltip
:content=
"$t('navbar.size')"
effect=
"dark"
placement=
"bottom"
>
<size-select
class=
"international right-menu-item"
/>
</el-tooltip>
<lang-select
class=
"international right-menu-item"
/>
<el-tooltip
:content=
"$t('navbar.theme')"
effect=
"dark"
placement=
"bottom"
>
...
...
@@ -48,6 +52,7 @@ import Breadcrumb from '@/components/Breadcrumb'
import
Hamburger
from
'
@/components/Hamburger
'
import
ErrorLog
from
'
@/components/ErrorLog
'
import
Screenfull
from
'
@/components/Screenfull
'
import
SizeSelect
from
'
@/components/SizeSelect
'
import
LangSelect
from
'
@/components/LangSelect
'
import
ThemePicker
from
'
@/components/ThemePicker
'
...
...
@@ -57,6 +62,7 @@ export default {
Hamburger
,
ErrorLog
,
Screenfull
,
SizeSelect
,
LangSelect
,
ThemePicker
},
...
...
src/views/redirect/index.vue
0 → 100644
浏览文件 @
0fbda3c8
<
script
>
export
default
{
beforeCreate
()
{
const
path
=
this
.
$route
.
params
.
path
this
.
$router
.
replace
(
'
/
'
+
path
)
},
render
:
function
(
h
)
{
return
h
()
// avoid warning message
}
}
</
script
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录