Skip to content

Commit 09d4ee5

Browse files
committed
fix(setting): update setting
1 parent 04932ec commit 09d4ee5

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/layouts/setting.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</t-drawer>
9292
</template>
9393
<script setup lang="ts">
94-
import { ref, computed, watch, onMounted } from 'vue';
94+
import { ref, computed, watch, onMounted, watchEffect } from 'vue';
9595
import { useStore } from 'vuex';
9696
import { ColorPicker } from 'vue-color-kit';
9797
import { MessagePlugin, PopupVisibleChangeContext } from 'tdesign-vue-next';
@@ -219,12 +219,9 @@ const getThumbnailUrl = (name: string): string => {
219219
return `https://tdesign.gtimg.com/tdesign-pro/setting/${name}.png`;
220220
};
221221
222-
watch(
223-
() => formData.value,
224-
(newVal) => {
225-
store.dispatch('setting/changeTheme', newVal);
226-
},
227-
);
222+
watchEffect(() => {
223+
store.dispatch('setting/changeTheme', formData.value);
224+
});
228225
</script>
229226
<style lang="less">
230227
@import '@/style/variables';

0 commit comments

Comments
 (0)