ToggleTheme

This commit is contained in:
2023-08-14 16:45:26 +03:00
parent 683d4375ff
commit b771d209ee
5 changed files with 60 additions and 17 deletions
+21
View File
@@ -0,0 +1,21 @@
<script setup lang="ts">
import UiIcon from './Icon.vue'
// Props.
const props = defineProps<{
dark?: boolean
}>()
// Emits.
const emit = defineEmits<{ (e: 'update:dark', v: boolean): void }>()
</script>
<template>
<div class="ui-toggle-theme">
<ui-icon
:name="props.dark ? 'moon' : 'sun'"
@click="emit('update:dark', !props.dark)"
title="Переключить тему"
/>
</div>
</template>
+1
View File
@@ -17,3 +17,4 @@ export { default as UiForm } from './Form.vue'
export { default as UiCard } from './Card.vue'
export { default as UiTable } from './Table.vue'
export { default as UiDialog } from './Dialog.vue'
export { default as UiToggleTheme } from './ToggleTheme.vue'