Files
ndm-web-client/src/components/theme-switch.vue
yangsy 0b3877797d chore
2025-08-14 12:51:31 +08:00

22 lines
610 B
Vue

<script setup lang="ts">
import { useThemeStore } from '@/stores/theme';
import { MoonOutline, SunnyOutline } from '@vicons/ionicons5';
import { NIcon, NSwitch } from 'naive-ui';
import { storeToRefs } from 'pinia';
const themeStore = useThemeStore();
const { darkThemeEnabled } = storeToRefs(themeStore);
</script>
<template>
<NSwitch v-model:value="darkThemeEnabled" size="small">
<template #unchecked-icon>
<NIcon :component="SunnyOutline" />
</template>
<template #checked-icon>
<NIcon :component="MoonOutline" />
</template>
</NSwitch>
</template>
<style scoped></style>