feat(App): 添加 naive-ui 主题覆盖配置
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -1,14 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
import { darkTheme } from 'naive-ui';
|
import { darkTheme, type GlobalThemeOverrides } from 'naive-ui';
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
||||||
|
// https://www.naiveui.com/zh-CN/light/docs/customize-theme
|
||||||
|
const themeOverrides: GlobalThemeOverrides = {
|
||||||
|
common: {},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DynamicDialog />
|
<DynamicDialog />
|
||||||
<ConfirmDialog />
|
<ConfirmDialog />
|
||||||
<Toast />
|
<Toast />
|
||||||
<n-config-provider preflight-style-disabled :theme="appStore.isDark ? darkTheme : null" abstract>
|
<n-config-provider
|
||||||
|
:theme-overrides
|
||||||
|
preflight-style-disabled
|
||||||
|
:theme="appStore.isDark ? darkTheme : null"
|
||||||
|
abstract
|
||||||
|
>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</n-config-provider>
|
</n-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user