From 3e92b7f1e04a709df231fce22801b55619e8faab Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Mon, 4 Apr 2022 01:52:59 +0200 Subject: [PATCH] feat(style): dark mode --- src/App.vue | 7 ++++++- src/layouts/base.layout.vue | 19 ++++++++++++++----- src/stores/style.store.ts | 5 +++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/stores/style.store.ts diff --git a/src/App.vue b/src/App.vue index abbb3621..14139b3e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,16 +5,21 @@ import { computed } from 'vue'; import { useRoute } from 'vue-router' import { + darkTheme, NConfigProvider, NGlobalStyle, } from 'naive-ui' +import { useStyleStore } from './stores/style.store'; const route = useRoute(); const layout = computed(() => route?.meta?.layout ?? layouts.base) +const styleStore = useStyleStore() + +const theme = computed(() => styleStore.isDarkTheme ? darkTheme : null)