feat(style): dark mode

This commit is contained in:
Corentin Thomasset 2022-04-04 01:52:59 +02:00
parent e8594de7b4
commit 3e92b7f1e0
No known key found for this signature in database
GPG key ID: DBD997E935996158
3 changed files with 25 additions and 6 deletions

View file

@ -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)
</script>
<template>
<n-config-provider>
<n-config-provider :theme="theme">
<n-global-style />
<n-message-provider placement="bottom">
<component :is="layout">