mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
update
This commit is contained in:
13
src/Utils.ts
13
src/Utils.ts
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user