diff --git a/src/components/setting/Setting.vue b/src/components/setting/Setting.vue index d7e82ce..2da169b 100644 --- a/src/components/setting/Setting.vue +++ b/src/components/setting/Setting.vue @@ -57,7 +57,7 @@ 动画效果 {{item.alias}} @@ -67,7 +67,7 @@ 动画方向 {{item}} @@ -84,7 +84,7 @@ import SettingItem from './SettingItem' import ColorCheckbox from '../checkbox/ColorCheckbox' import ImgCheckbox from '../checkbox/ImgCheckbox' import Clipboard from 'clipboard' -import themeUtil from '../../utils/themeUtil'; +import themeUtil from '../../utils/themeUtil' import { mapState } from 'vuex' const ColorCheckboxGroup = ColorCheckbox.Group @@ -101,11 +101,6 @@ export default { colors, } }, - watch: { - animate() { - this.direction = this.directions[0] - } - }, computed: { directions() { return this.animates.find(item => item.name == this.animate).directions @@ -143,12 +138,11 @@ export default { setWeekMode(checked) { this.$store.commit('setting/setWeekMode', checked) }, - setAnimate() { - let animate = { - name: this.animate, - direction: this.direction + setAnimate(animate, direction) { + if (direction == undefined) { + this.direction = this.directions[0] } - this.$store.commit('setting/setAnimate', animate) + this.$store.commit('setting/setAnimate', {name: this.animate, direction: this.direction}) }, setFixedHeader(checked) { this.$store.commit('setting/setFixedHeader', checked)