This commit is contained in:
2023-10-16 11:27:37 +08:00
parent 826f99350c
commit b5b55dc3b2
29 changed files with 951 additions and 319 deletions

View File

@@ -1,3 +1,14 @@
import { useOsTheme } from "naive-ui"
import { ThemeType } from "./api/api-models"
import { useStorage } from "@vueuse/core"
const osThemeRef = useOsTheme() //获取当前系统主题
export function NavigateToNewTab(url: string) {
window.open(url, '_blank')
}
}
const themeType = useStorage('Settings.Theme', ThemeType.Auto)
export function isDarkMode(): boolean {
if (themeType.value == ThemeType.Auto) return osThemeRef.value === 'dark'
else return themeType.value == ThemeType.Dark
}