mirror of
https://github.com/EasyTier/EasytierGame.git
synced 2025-05-19 10:27:56 +00:00
增加根据windows主题切换主题颜色的功能,优化高级配置界面显示,增加网卡名称配置
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { useDark, useToggle, usePreferredDark } from "@vueuse/core";
|
||||
import { isFunction } from "lodash-es";
|
||||
const isDark = usePreferredDark();
|
||||
const darkConfig = useDark({
|
||||
selector: "html",
|
||||
attribute: "class",
|
||||
valueDark: "dark",
|
||||
valueLight: "",
|
||||
});
|
||||
const toggleDark = useToggle(darkConfig);
|
||||
export const initTheme = () => {
|
||||
if (isDark && isFunction(toggleDark)) {
|
||||
toggleDark(isDark.value);
|
||||
}
|
||||
};
|
||||
|
||||
export const setTheme = (dark: boolean) => {
|
||||
if (isFunction(toggleDark)) {
|
||||
toggleDark(dark);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user