pref: update useDarkMode

This commit is contained in:
thehrz 2023-07-30 17:31:32 +08:00
parent c1ea1865a4
commit 527dc45bc0
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
3 changed files with 5 additions and 7 deletions

View File

@ -146,7 +146,7 @@ declare global {
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement'] const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
const useCycleList: typeof import('@vueuse/core')['useCycleList'] const useCycleList: typeof import('@vueuse/core')['useCycleList']
const useDark: typeof import('@vueuse/core')['useDark'] const useDark: typeof import('@vueuse/core')['useDark']
const useDarkMode: typeof import('./composables/dark')['useDarkMode'] const useDarkMode: typeof import('./composables/useDarkMode')['default']
const useDateFormat: typeof import('@vueuse/core')['useDateFormat'] const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
const useDebounce: typeof import('@vueuse/core')['useDebounce'] const useDebounce: typeof import('@vueuse/core')['useDebounce']
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn'] const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
@ -443,7 +443,7 @@ declare module 'vue' {
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']> readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']> readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']> readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
readonly useDarkMode: UnwrapRef<typeof import('./composables/dark')['useDarkMode']> readonly useDarkMode: UnwrapRef<typeof import('./composables/useDarkMode')['default']>
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']> readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']> readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']> readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>
@ -734,7 +734,7 @@ declare module '@vue/runtime-core' {
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']> readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']> readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']> readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
readonly useDarkMode: UnwrapRef<typeof import('./composables/dark')['useDarkMode']> readonly useDarkMode: UnwrapRef<typeof import('./composables/useDarkMode')['default']>
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']> readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']> readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']> readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>

View File

@ -1,6 +1,6 @@
import { useTheme } from 'vuetify' import { useTheme } from 'vuetify'
export function useDarkMode() { export default () => {
const theme = useTheme() const theme = useTheme()
const isDark = () => theme.global.current.value.dark const isDark = () => theme.global.current.value.dark

View File

@ -10,12 +10,10 @@ import '@unocss/reset/tailwind.css'
import './styles/main.css' import './styles/main.css'
import 'uno.css' import 'uno.css'
const routes = setupLayouts(generatedRoutes)
// https://github.com/antfu/vite-ssg // https://github.com/antfu/vite-ssg
export const createApp = ViteSSG( export const createApp = ViteSSG(
App, App,
{ routes, base: import.meta.env.BASE_URL }, { routes: setupLayouts(generatedRoutes), base: import.meta.env.BASE_URL },
(ctx) => { (ctx) => {
// install all modules under `modules/` // install all modules under `modules/`
Object.values(import.meta.glob<{ install: UserModule }>('./modules/*.ts', { eager: true })) Object.values(import.meta.glob<{ install: UserModule }>('./modules/*.ts', { eager: true }))