Compare commits

..

No commits in common. "671504bb33db6ef43f978c2314bf6e3f425c19bf" and "ebf41d74c8830e185f78c2f10c9cf74706b7412c" have entirely different histories.

3 changed files with 4 additions and 19 deletions

View File

@ -1,14 +0,0 @@
import { useDark } from '@vueuse/core'
const darkOptions = {
selector: 'html',
attribute: 'class',
valueDark: 'dark',
valueLight: '',
storageKey: 'guzhi-color-scheme',
initialValue: 'light',
}
export function useAppDark() {
return useDark(darkOptions)
}

View File

@ -1,10 +1,9 @@
<script setup>
import { useAppStore } from '@/store'
import { useToggle } from '@vueuse/core'
import { useAppDark } from '@/composables/useAppDark'
import { useDark, useToggle } from '@vueuse/core'
const appStore = useAppStore()
const isDark = useAppDark()
const isDark = useDark()
const toggleDark = () => {
appStore.toggleDark()
useToggle(isDark)()

View File

@ -1,12 +1,12 @@
import { defineStore } from 'pinia'
import { useDark } from '@vueuse/core'
import { lStorage } from '@/utils'
import i18n from '~/i18n'
import { useAppDark } from '@/composables/useAppDark'
const currentLocale = lStorage.get('locale')
const { locale } = i18n.global
const isDark = useAppDark()
const isDark = useDark()
export const useAppStore = defineStore('app', {
state() {
return {