From fc32099b386f6cd4b0e2752ebdae346f0d94fc5b Mon Sep 17 00:00:00 2001 From: thehrz Date: Fri, 21 Jul 2023 18:07:21 +0800 Subject: [PATCH] perf: update dark mode --- src/auto-imports.d.ts | 14 ++++++-------- src/components/Nav.vue | 4 ++-- src/composables/dark.ts | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 054c76e..69ea04b 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -43,7 +43,6 @@ declare global { const h: typeof import('vue')['h'] const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch'] const inject: typeof import('vue')['inject'] - const isDark: typeof import('./composables/dark')['isDark'] const isDefined: typeof import('@vueuse/core')['isDefined'] const isProxy: typeof import('vue')['isProxy'] const isReactive: typeof import('vue')['isReactive'] @@ -72,7 +71,6 @@ declare global { const onUnmounted: typeof import('vue')['onUnmounted'] const onUpdated: typeof import('vue')['onUpdated'] const pausableWatch: typeof import('@vueuse/core')['pausableWatch'] - const preferredDark: typeof import('./composables/dark')['preferredDark'] const provide: typeof import('vue')['provide'] const reactify: typeof import('@vueuse/core')['reactify'] const reactifyObject: typeof import('@vueuse/core')['reactifyObject'] @@ -88,7 +86,6 @@ declare global { const refThrottled: typeof import('@vueuse/core')['refThrottled'] const refWithControl: typeof import('@vueuse/core')['refWithControl'] const resolveComponent: typeof import('vue')['resolveComponent'] - const resolveDirective: typeof import('vue')['resolveDirective'] const resolveRef: typeof import('@vueuse/core')['resolveRef'] const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] const shallowReactive: typeof import('vue')['shallowReactive'] @@ -104,8 +101,6 @@ declare global { const toRef: typeof import('vue')['toRef'] const toRefs: typeof import('vue')['toRefs'] const toValue: typeof import('vue')['toValue'] - const toggleDark: typeof import('./composables/dark')['toggleDark'] - const toggleTheme: typeof import('./composables/dark')['toggleTheme'] const triggerRef: typeof import('vue')['triggerRef'] const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount'] const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount'] @@ -149,7 +144,8 @@ declare global { const useCssVars: typeof import('vue')['useCssVars'] const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement'] const useCycleList: typeof import('@vueuse/core')['useCycleList'] - const useDark: typeof import('./composables/dark')['useDark'] + const useDark: typeof import('@vueuse/core')['useDark'] + const useDarkMode: typeof import('./composables/dark')['useDarkMode'] const useDateFormat: typeof import('@vueuse/core')['useDateFormat'] const useDebounce: typeof import('@vueuse/core')['useDebounce'] const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn'] @@ -444,7 +440,8 @@ declare module 'vue' { readonly useCssVars: UnwrapRef readonly useCurrentElement: UnwrapRef readonly useCycleList: UnwrapRef - readonly useDark: UnwrapRef + readonly useDark: UnwrapRef + readonly useDarkMode: UnwrapRef readonly useDateFormat: UnwrapRef readonly useDebounce: UnwrapRef readonly useDebounceFn: UnwrapRef @@ -733,7 +730,8 @@ declare module '@vue/runtime-core' { readonly useCssVars: UnwrapRef readonly useCurrentElement: UnwrapRef readonly useCycleList: UnwrapRef - readonly useDark: UnwrapRef + readonly useDark: UnwrapRef + readonly useDarkMode: UnwrapRef readonly useDateFormat: UnwrapRef readonly useDebounce: UnwrapRef readonly useDebounceFn: UnwrapRef diff --git a/src/components/Nav.vue b/src/components/Nav.vue index 2670bfa..78659d6 100644 --- a/src/components/Nav.vue +++ b/src/components/Nav.vue @@ -20,7 +20,7 @@ const pages = [ const { t } = useI18n() -const { isDark, toggleDark } = useDark() +const { isDark, toggleDark } = useDarkMode()