mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 23:06:14 -04:00
feat(style): dark mode
This commit is contained in:
parent
e8594de7b4
commit
3e92b7f1e0
3 changed files with 25 additions and 6 deletions
|
@ -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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue