File tree Expand file tree Collapse file tree 5 files changed +44
-44
lines changed Expand file tree Collapse file tree 5 files changed +44
-44
lines changed Original file line number Diff line number Diff line change 108
108
& .userLayout {
109
109
overflow-y : auto ;
110
110
}
111
+
112
+ & .colorWeak {
113
+ filter : invert (80% );
114
+ }
111
115
}
112
116
113
117
.layout {
Original file line number Diff line number Diff line change 76
76
<script >
77
77
import DetailList from ' @/components/tools/DetailList'
78
78
import config from ' @/defaultConfig'
79
- import { updateTheme } from ' @/components/tools/setting'
80
-
79
+ import { updateTheme , colorList } from ' @/components/tools/setting'
81
80
import { mapState } from ' vuex'
82
81
83
- const colorList = [
84
- {
85
- key: ' 薄暮' ,
86
- color: ' #F5222D' ,
87
- },
88
- {
89
- key: ' 火山' ,
90
- color: ' #FA541C' ,
91
- },
92
- {
93
- key: ' 日暮' ,
94
- color: ' #FAAD14' ,
95
- },
96
- {
97
- key: ' 明青' ,
98
- color: ' #13C2C2' ,
99
- },
100
- {
101
- key: ' 极光绿' ,
102
- color: ' #52C41A' ,
103
- },
104
- {
105
- key: ' 拂晓蓝(默认)' ,
106
- color: ' #1890FF' ,
107
- },
108
- {
109
- key: ' 极客蓝' ,
110
- color: ' #2F54EB' ,
111
- },
112
- {
113
- key: ' 酱紫' ,
114
- color: ' #722ED1' ,
115
- },
116
- ];
117
-
118
82
export default {
119
83
components: {
120
84
DetailList
Original file line number Diff line number Diff line change @@ -64,4 +64,31 @@ const updateColorWeak = colorWeak => {
64
64
document . body . className = colorWeak ? 'colorWeak' : '' ;
65
65
} ;
66
66
67
- export { updateTheme , updateColorWeak }
67
+ const colorList = [
68
+ {
69
+ key : '薄暮' , color : '#F5222D' ,
70
+ } ,
71
+ {
72
+ key : '火山' , color : '#FA541C' ,
73
+ } ,
74
+ {
75
+ key : '日暮' , color : '#FAAD14' ,
76
+ } ,
77
+ {
78
+ key : '明青' , color : '#13C2C2' ,
79
+ } ,
80
+ {
81
+ key : '极光绿' , color : '#52C41A' ,
82
+ } ,
83
+ {
84
+ key : '拂晓蓝(默认)' , color : '#1890FF' ,
85
+ } ,
86
+ {
87
+ key : '极客蓝' , color : '#2F54EB' ,
88
+ } ,
89
+ {
90
+ key : '酱紫' , color : '#722ED1' ,
91
+ } ,
92
+ ] ;
93
+
94
+ export { updateTheme , colorList , updateColorWeak }
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { mapState } from " vuex"
3
+ import { colorList } from ' @/components/tools/setting'
3
4
import ASwitch from ' ant-design-vue/es/switch'
4
5
import AList from " ant-design-vue/es/list"
5
6
import AListItem from " ant-design-vue/es/list/Item"
19
20
},
20
21
computed: {
21
22
... mapState ({
22
- theme : state => state .app .theme
23
+ theme : state => state .app .theme ,
24
+ color : state => state .app .color
23
25
})
24
26
},
25
27
filters: {
29
31
' light' : ' 白色'
30
32
}
31
33
return themeMap[theme]
32
- }
34
+ },
33
35
},
34
36
methods: {
35
- onChange (checked ) {
37
+ colorFilter (color ) {
38
+ const c = colorList .filter (o => o .color === color)[0 ]
39
+ return c && c .key
40
+ },
36
41
37
- console . log ( ' click: ' , checked)
42
+ onChange ( checked ) {
38
43
if (checked) {
39
44
this .$store .dispatch (' ToggleTheme' , ' dark' )
40
45
} else {
60
65
< Meta>
61
66
< a slot= " title" > 主题色< / a>
62
67
< span slot= " description" >
63
- 页面风格配色: < a> 红 < / a >
68
+ 页面风格配色: < a domPropsInnerHTML = { this . colorFilter ( this . color ) } / >
64
69
< / span>
65
70
< / Meta>
66
71
< / AListItem>
Original file line number Diff line number Diff line change 5
5
>
6
6
<a-list-item slot =" renderItem" slot-scope =" item, index" :key =" index" >
7
7
<a-list-item-meta >
8
- <a slot =" title" href = " https://vuecomponent.github.io/ant-design-vue/ " >{{ item.title }}</a >
8
+ <a slot =" title" >{{ item.title }}</a >
9
9
<span slot =" description" >
10
10
<span class =" security-list-description" >{{ item.description }}</span >
11
11
<span v-if =" item.value" > : </span >
You can’t perform that action at this time.
0 commit comments