feat(projects): 集成naiveUI主题配置,将css vars添加至html

This commit is contained in:
Soybean
2022-01-04 02:20:32 +08:00
parent 0d2a5629e8
commit 2c196841bd
12 changed files with 297 additions and 88 deletions

View File

@@ -1,6 +1,19 @@
<template>
<router-view />
<n-config-provider :theme-overrides="theme.naiveThemeOverrides">
<router-view />
</n-config-provider>
</template>
<script setup lang="ts"></script>
<script setup lang="ts">
import { onMounted } from 'vue';
import { NConfigProvider } from 'naive-ui';
import { useThemeStore } from '@/store';
const theme = useThemeStore();
const { addThemeCssVarsToRoot } = useThemeStore();
onMounted(() => {
addThemeCssVarsToRoot();
});
</script>
<style scoped></style>