first commit

This commit is contained in:
zc
2026-02-26 17:31:18 +08:00
commit f1b87df6ca
803 changed files with 297148 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<template>
<a-button size="mini" class="gi_hover_btn" @click="handleToggleTheme">
<template #icon>
<icon-moon-fill v-if="appStore.theme === 'light'" :size="18" />
<icon-sun-fill v-else :size="18" />
</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>