first commit

This commit is contained in:
2024-04-08 21:34:02 +08:00
commit a41a7f32ab
223 changed files with 44629 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<template>
<a-button size="mini" class="gi_hover_btn" @click="handleToggleTheme">
<template #icon>
<icon-sun-fill :size="18" v-if="appStore.theme === 'light'"></icon-sun-fill>
<icon-moon-fill :size="18" v-else></icon-moon-fill>
</template>
</a-button>
</template>
<script setup lang="ts">
import { useDark, useToggle } from '@vueuse/core'
import { useAppStore } from '@/stores'
defineOptions({ name: 'GiThemeBtn' })
const appStore = useAppStore()
const isDark = useDark({
selector: 'body',
attribute: 'arco-theme',
valueDark: 'dark',
valueLight: 'light',
storageKey: 'arco-theme',
onChanged(dark: boolean) {
appStore.toggleTheme(dark)
}
})
const toggleTheme = useToggle(isDark)
const handleToggleTheme = () => {
toggleTheme()
}
</script>