Skip to content

Commit 81d667f

Browse files
committed
update setting drawer
1 parent e0d7253 commit 81d667f

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

src/components/layout/LayoutMain.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@
108108
&.userLayout {
109109
overflow-y: auto;
110110
}
111+
112+
&.colorWeak {
113+
filter: invert(80%);
114+
}
111115
}
112116
113117
.layout {

src/components/tools/SettingDrawer.vue

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,45 +76,9 @@
7676
<script>
7777
import DetailList from '@/components/tools/DetailList'
7878
import config from '@/defaultConfig'
79-
import { updateTheme } from '@/components/tools/setting'
80-
79+
import { updateTheme, colorList } from '@/components/tools/setting'
8180
import { mapState } from 'vuex'
8281
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-
11882
export default {
11983
components: {
12084
DetailList

src/components/tools/setting.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,31 @@ const updateColorWeak = colorWeak => {
6464
document.body.className = colorWeak ? 'colorWeak' : '';
6565
};
6666

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 }

src/views/account/settings/Custom.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script>
22
import { mapState } from "vuex"
3+
import { colorList } from '@/components/tools/setting'
34
import ASwitch from 'ant-design-vue/es/switch'
45
import AList from "ant-design-vue/es/list"
56
import AListItem from "ant-design-vue/es/list/Item"
@@ -19,7 +20,8 @@
1920
},
2021
computed: {
2122
...mapState({
22-
theme: state => state.app.theme
23+
theme: state => state.app.theme,
24+
color: state => state.app.color
2325
})
2426
},
2527
filters: {
@@ -29,12 +31,15 @@
2931
'light': '白色'
3032
}
3133
return themeMap[theme]
32-
}
34+
},
3335
},
3436
methods: {
35-
onChange (checked) {
37+
colorFilter(color) {
38+
const c = colorList.filter(o => o.color === color)[0]
39+
return c && c.key
40+
},
3641
37-
console.log('click:', checked)
42+
onChange (checked) {
3843
if (checked) {
3944
this.$store.dispatch('ToggleTheme', 'dark')
4045
} else {
@@ -60,7 +65,7 @@
6065
<Meta>
6166
<a slot="title">主题色</a>
6267
<span slot="description">
63-
页面风格配色: <a></a>
68+
页面风格配色: <a domPropsInnerHTML={ this.colorFilter(this.color) }/>
6469
</span>
6570
</Meta>
6671
</AListItem>

src/views/account/settings/Security.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
>
66
<a-list-item slot="renderItem" slot-scope="item, index" :key="index">
77
<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>
99
<span slot="description">
1010
<span class="security-list-description">{{ item.description }}</span>
1111
<span v-if="item.value"> : </span>

0 commit comments

Comments
 (0)