mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-08 11:26:56 +08:00
15 lines
494 B
TypeScript
15 lines
494 B
TypeScript
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
|
|
}
|