Skip to content

Commit

Permalink
主题颜色随系统变化
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy0 committed May 18, 2023
1 parent 8846ba3 commit 1191a88
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ hljs.registerLanguage("json", json)
hljs.registerLanguage("http", http)
hljs.registerLanguage("xml", xml)
import { useOsTheme, darkTheme } from "naive-ui";
import {computed} from "vue";
const osThemeRef = useOsTheme();
const theme = computed(() => osThemeRef.value === "dark" ? darkTheme : null);
</script>

<template>
<n-config-provider :hljs="hljs">
<n-config-provider :hljs="hljs" :theme="theme">
<Home/>
</n-config-provider>
</template>
Expand Down

0 comments on commit 1191a88

Please sign in to comment.