Skip to content

Commit

Permalink
fix: 修复图标弹窗配置未同步的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyin committed Nov 5, 2024
1 parent 038ec62 commit b5a2482
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/views/icon/IconPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,26 @@
<script setup lang="ts">
import { Toast } from "@nutui/nutui";
import axios from "axios";
import { ref, watch, computed, reactive, onMounted } from 'vue'
import { ref, watch, watchEffect, computed, reactive, onMounted } from 'vue'
import { storeToRefs } from "pinia";
import { useGlobalStore } from "@/store/global";
import { useSettingsStore } from '@/store/settings';
import { useI18n } from "vue-i18n";
import { useDebounceFn } from '@vueuse/core'

const { t } = useI18n();
const globalStore = useGlobalStore();
const {
bottomSafeArea,
isIconColor,
defaultIconCollection
} = storeToRefs(globalStore);
const settingsStore = useSettingsStore();
const { changeAppearanceSetting } = settingsStore;
const { appearanceSetting } = storeToRefs(settingsStore);
const { bottomSafeArea, defaultIconCollection } = storeToRefs(globalStore);

const setIconColor = (isIconColor: boolean) => {
globalStore.setIconColor(isIconColor);
const data = {
...appearanceSetting.value,
isIconColor,
};
changeAppearanceSetting({ appearanceSetting: data });
};
const form = reactive({
iconName: "",
Expand Down Expand Up @@ -214,6 +218,12 @@ const defaultIconCollectionColumns = ref([
},
]);

const isIconColor = ref(false);

watchEffect(() => {
isIconColor.value = appearanceSetting.value.isIconColor;
});

// 默认图标仓库
const defaultIconCollectionValue = ref([""]);

Expand Down

0 comments on commit b5a2482

Please sign in to comment.