Commit 56947a11 by Sendya

update setting drawer

parent ed697ef4
...@@ -108,6 +108,10 @@ ...@@ -108,6 +108,10 @@
&.userLayout { &.userLayout {
overflow-y: auto; overflow-y: auto;
} }
&.colorWeak {
filter: invert(80%);
}
} }
.layout { .layout {
......
...@@ -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
......
...@@ -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
<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>
......
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment