Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ant-design-pro-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianzhuanghu
ant-design-pro-vue
Commits
56947a11
Commit
56947a11
authored
Oct 22, 2018
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update setting drawer
parent
ed697ef4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
45 deletions
+45
-45
LayoutMain.vue
src/components/layout/LayoutMain.vue
+4
-0
SettingDrawer.vue
src/components/tools/SettingDrawer.vue
+1
-37
setting.js
src/components/tools/setting.js
+29
-2
Custom.vue
src/views/account/settings/Custom.vue
+10
-5
Security.vue
src/views/account/settings/Security.vue
+1
-1
No files found.
src/components/layout/LayoutMain.vue
View file @
56947a11
...
@@ -108,6 +108,10 @@
...
@@ -108,6 +108,10 @@
&.userLayout
{
&.userLayout
{
overflow-y
:
auto
;
overflow-y
:
auto
;
}
}
&
.colorWeak
{
filter
:
invert
(
80%
);
}
}
}
.layout
{
.layout
{
...
...
src/components/tools/SettingDrawer.vue
View file @
56947a11
...
@@ -76,45 +76,9 @@
...
@@ -76,45 +76,9 @@
<
script
>
<
script
>
import
DetailList
from
'@/components/tools/DetailList'
import
DetailList
from
'@/components/tools/DetailList'
import
config
from
'@/defaultConfig'
import
config
from
'@/defaultConfig'
import
{
updateTheme
}
from
'@/components/tools/setting'
import
{
updateTheme
,
colorList
}
from
'@/components/tools/setting'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
const
colorList
=
[
{
key
:
'薄暮'
,
color
:
'#F5222D'
,
},
{
key
:
'火山'
,
color
:
'#FA541C'
,
},
{
key
:
'日暮'
,
color
:
'#FAAD14'
,
},
{
key
:
'明青'
,
color
:
'#13C2C2'
,
},
{
key
:
'极光绿'
,
color
:
'#52C41A'
,
},
{
key
:
'拂晓蓝(默认)'
,
color
:
'#1890FF'
,
},
{
key
:
'极客蓝'
,
color
:
'#2F54EB'
,
},
{
key
:
'酱紫'
,
color
:
'#722ED1'
,
},
];
export
default
{
export
default
{
components
:
{
components
:
{
DetailList
DetailList
...
...
src/components/tools/setting.js
View file @
56947a11
...
@@ -64,4 +64,31 @@ const updateColorWeak = colorWeak => {
...
@@ -64,4 +64,31 @@ const updateColorWeak = colorWeak => {
document
.
body
.
className
=
colorWeak
?
'colorWeak'
:
''
;
document
.
body
.
className
=
colorWeak
?
'colorWeak'
:
''
;
};
};
export
{
updateTheme
,
updateColorWeak
}
const
colorList
=
[
\ No newline at end of file
{
key
:
'薄暮'
,
color
:
'#F5222D'
,
},
{
key
:
'火山'
,
color
:
'#FA541C'
,
},
{
key
:
'日暮'
,
color
:
'#FAAD14'
,
},
{
key
:
'明青'
,
color
:
'#13C2C2'
,
},
{
key
:
'极光绿'
,
color
:
'#52C41A'
,
},
{
key
:
'拂晓蓝(默认)'
,
color
:
'#1890FF'
,
},
{
key
:
'极客蓝'
,
color
:
'#2F54EB'
,
},
{
key
:
'酱紫'
,
color
:
'#722ED1'
,
},
];
export
{
updateTheme
,
colorList
,
updateColorWeak
}
\ No newline at end of file
src/views/account/settings/Custom.vue
View file @
56947a11
<
script
>
<
script
>
import
{
mapState
}
from
"vuex"
import
{
mapState
}
from
"vuex"
import
{
colorList
}
from
'@/components/tools/setting'
import
ASwitch
from
'ant-design-vue/es/switch'
import
ASwitch
from
'ant-design-vue/es/switch'
import
AList
from
"ant-design-vue/es/list"
import
AList
from
"ant-design-vue/es/list"
import
AListItem
from
"ant-design-vue/es/list/Item"
import
AListItem
from
"ant-design-vue/es/list/Item"
...
@@ -19,7 +20,8 @@
...
@@ -19,7 +20,8 @@
},
},
computed
:
{
computed
:
{
...
mapState
({
...
mapState
({
theme
:
state
=>
state
.
app
.
theme
theme
:
state
=>
state
.
app
.
theme
,
color
:
state
=>
state
.
app
.
color
})
})
},
},
filters
:
{
filters
:
{
...
@@ -29,12 +31,15 @@
...
@@ -29,12 +31,15 @@
'light'
:
'白色'
'light'
:
'白色'
}
}
return
themeMap
[
theme
]
return
themeMap
[
theme
]
}
}
,
},
},
methods
:
{
methods
:
{
onChange
(
checked
)
{
colorFilter
(
color
)
{
const
c
=
colorList
.
filter
(
o
=>
o
.
color
===
color
)[
0
]
return
c
&&
c
.
key
},
console
.
log
(
'click:'
,
checked
)
onChange
(
checked
)
{
if
(
checked
)
{
if
(
checked
)
{
this
.
$store
.
dispatch
(
'ToggleTheme'
,
'dark'
)
this
.
$store
.
dispatch
(
'ToggleTheme'
,
'dark'
)
}
else
{
}
else
{
...
@@ -60,7 +65,7 @@
...
@@ -60,7 +65,7 @@
<
Meta
>
<
Meta
>
<
a
slot
=
"title"
>
主题色
<
/a
>
<
a
slot
=
"title"
>
主题色
<
/a
>
<
span
slot
=
"description"
>
<
span
slot
=
"description"
>
页面风格配色:
<
a
>
红
<
/a
>
页面风格配色:
<
a
domPropsInnerHTML
=
{
this
.
colorFilter
(
this
.
color
)
}
/
>
<
/span
>
<
/span
>
<
/Meta
>
<
/Meta
>
<
/AListItem
>
<
/AListItem
>
...
...
src/views/account/settings/Security.vue
View file @
56947a11
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
>
>
<a-list-item
slot=
"renderItem"
slot-scope=
"item, index"
:key=
"index"
>
<a-list-item
slot=
"renderItem"
slot-scope=
"item, index"
:key=
"index"
>
<a-list-item-meta>
<a-list-item-meta>
<a
slot=
"title"
href=
"https://vuecomponent.github.io/ant-design-vue/"
>
{{
item
.
title
}}
</a>
<a
slot=
"title"
>
{{
item
.
title
}}
</a>
<span
slot=
"description"
>
<span
slot=
"description"
>
<span
class=
"security-list-description"
>
{{
item
.
description
}}
</span>
<span
class=
"security-list-description"
>
{{
item
.
description
}}
</span>
<span
v-if=
"item.value"
>
:
</span>
<span
v-if=
"item.value"
>
:
</span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment