mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
chore: optimizing the implementation logic of theme color modification; 🌟
This commit is contained in:
parent
c6419173ac
commit
98e02874ed
@ -7,6 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import enquireScreen from './utils/device'
|
import enquireScreen from './utils/device'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
|
import themeUtil from '@/utils/themeUtil';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
@ -31,10 +32,16 @@ export default {
|
|||||||
},
|
},
|
||||||
lang(val) {
|
lang(val) {
|
||||||
this.setLanguage(val)
|
this.setLanguage(val)
|
||||||
|
},
|
||||||
|
themeColor(val) {
|
||||||
|
let closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
|
||||||
|
themeUtil.changeThemeColor(val).then(() => {
|
||||||
|
setTimeout(closeMessage, 1000)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('setting', ['weekMode', 'lang'])
|
...mapState('setting', ['theme', 'themeColor', 'weekMode', 'lang'])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setWeekModeTheme(weekMode) {
|
setWeekModeTheme(weekMode) {
|
||||||
|
@ -84,7 +84,6 @@ import SettingItem from './SettingItem'
|
|||||||
import ColorCheckbox from '../checkbox/ColorCheckbox'
|
import ColorCheckbox from '../checkbox/ColorCheckbox'
|
||||||
import ImgCheckbox from '../checkbox/ImgCheckbox'
|
import ImgCheckbox from '../checkbox/ImgCheckbox'
|
||||||
import Clipboard from 'clipboard'
|
import Clipboard from 'clipboard'
|
||||||
import themeUtil from '../../utils/themeUtil'
|
|
||||||
import { mapState, mapMutations } from 'vuex'
|
import { mapState, mapMutations } from 'vuex'
|
||||||
|
|
||||||
const ColorCheckboxGroup = ColorCheckbox.Group
|
const ColorCheckboxGroup = ColorCheckbox.Group
|
||||||
@ -112,12 +111,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
onColorChange (values, colors) {
|
onColorChange (values, colors) {
|
||||||
if (colors.length > 0) {
|
if (colors.length > 0) {
|
||||||
let closeMessage = this.$message.loading(`您选择了主题色 ${colors}, 正在切换...`)
|
this.setThemeColor(colors[0])
|
||||||
let _this = this
|
|
||||||
themeUtil.changeThemeColor(colors[0]).then(() => {
|
|
||||||
_this.setThemeColor(colors[0])
|
|
||||||
closeMessage()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
copyCode () {
|
copyCode () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user