This commit is contained in:
yangsy
2025-08-14 03:22:59 +08:00
parent eab84c1e83
commit a7f9e1c272
13 changed files with 69 additions and 82 deletions

View File

@@ -1,11 +1,11 @@
import type { Station } from '@/apis/domains'
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import type { Station } from '@/apis/domains';
import { defineStore } from 'pinia';
import { computed, ref } from 'vue';
export const useStationStore = defineStore('ndmstation', () => {
const stationList = ref<Station[]>([])
export const useStationStore = defineStore('ndm-station-store', () => {
const stationList = ref<Station[]>([]);
const onlineStationList = computed(() => stationList.value.filter((station) => station.online))
const onlineStationList = computed(() => stationList.value.filter((station) => station.online));
return { stationList, onlineStationList }
})
return { stationList, onlineStationList };
});

View File

@@ -1,12 +1,12 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { darkTheme, lightTheme } from 'naive-ui'
import { ref, computed } from 'vue';
import { defineStore } from 'pinia';
import { darkTheme, lightTheme } from 'naive-ui';
export const useThemeStore = defineStore('ndm-theme', () => {
const darkThemeEnabled = ref(false)
export const useThemeStore = defineStore('ndm-theme-store', () => {
const darkThemeEnabled = ref(true);
const themeMode = computed(() => {
return darkThemeEnabled.value ? darkTheme : lightTheme
})
return darkThemeEnabled.value ? darkTheme : lightTheme;
});
return { darkThemeEnabled, themeMode }
})
return { darkThemeEnabled, themeMode };
});