修复设置意外被更改的问题

This commit is contained in:
lyswhut
2022-03-08 18:20:09 +08:00
parent 5e291255bb
commit 3ad4584159
5 changed files with 13 additions and 8 deletions
+6 -5
View File
@@ -8,7 +8,7 @@ import {
toRaw,
useCommit,
onBeforeUnmount,
watchEffect,
watch,
useRefGetter,
} from '@renderer/utils/vueTools'
@@ -43,12 +43,13 @@ export default ({
}) => {
const setSetting = useCommit('setSetting')
const windowSizeActive = useRefGetter('windowSizeActive')
const isShowAnimation = useRefGetter('isShowAnimation')
watchEffect(() => {
document.documentElement.style.fontSize = windowSizeActive.value.fontSize
watch(windowSizeActive, ({ fontSize }) => {
document.documentElement.style.fontSize = fontSize
})
watchEffect(() => {
if (setting.value.isShowAnimation) {
watch(isShowAnimation, val => {
if (val) {
if (document.body.classList.contains('disableAnimation')) {
document.body.classList.remove('disableAnimation')
}