chore
This commit is contained in:
22
src/components/theme-switch.vue
Normal file
22
src/components/theme-switch.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user