initial commit
This commit is contained in:
11
src/stores/station.ts
Normal file
11
src/stores/station.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { Station } from '@/apis/domains'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
export const useStationStore = defineStore('ndmstation', () => {
|
||||
const stationList = ref<Station[]>([])
|
||||
|
||||
const onlineStationList = computed(() => stationList.value.filter((station) => station.online))
|
||||
|
||||
return { stationList, onlineStationList }
|
||||
})
|
||||
12
src/stores/theme.ts
Normal file
12
src/stores/theme.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
const themeMode = computed(() => {
|
||||
return darkThemeEnabled.value ? darkTheme : lightTheme
|
||||
})
|
||||
|
||||
return { darkThemeEnabled, themeMode }
|
||||
})
|
||||
Reference in New Issue
Block a user