feat: enable composable auto import

This commit is contained in:
Anthony Fu committed 2022-05-24 15:17:55 +08:00
1 parent 8b72b2ee74
commit 4f220a63b4
10 files changed
+366 -59

No files matched your search

-2
View File
@@ -2,8 +2,6 @@
// https://github.com/vueuse/head
// you can use this to manipulate the document head in any components,
// they will be rendered correctly in the html results with vite-ssg
import { isDark, preferredDark } from '~/composables'
useHead({
title: 'Vitesse',
meta: [
+260 -8
View File
@@ -1,13 +1,14 @@
// Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control
export {}
declare global {
const $: typeof import('vue/macros')['$']
const $$: typeof import('vue/macros')['$$']
const $: typeof import('vue/macros')['$']
const $computed: typeof import('vue/macros')['$computed']
const $customRef: typeof import('vue/macros')['$customRef']
const $ref: typeof import('vue/macros')['$ref']
const $shallowRef: typeof import('vue/macros')['$shallowRef']
const $toRef: typeof import('vue/macros')['$toRef']
const EffectScope: typeof import('vue')['EffectScope']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
@@ -31,13 +32,13 @@ declare global {
const defineComponent: typeof import('vue')['defineComponent']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope']
const EffectScope: typeof import('vue')['EffectScope']
const extendRef: typeof import('@vueuse/core')['extendRef']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
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 isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
@@ -65,6 +66,7 @@ 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']
@@ -92,6 +94,7 @@ declare global {
const toReactive: typeof import('@vueuse/core')['toReactive']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toggleDark: typeof import('./composables/dark')['toggleDark']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
@@ -124,8 +127,8 @@ declare global {
const useDark: typeof import('@vueuse/core')['useDark']
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
const useDebounce: typeof import('@vueuse/core')['useDebounce']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
@@ -207,8 +210,8 @@ declare global {
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
const useThrottle: typeof import('@vueuse/core')['useThrottle']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
const useTimeout: typeof import('@vueuse/core')['useTimeout']
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
@@ -219,10 +222,11 @@ declare global {
const useTransition: typeof import('@vueuse/core')['useTransition']
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useUserStore: typeof import('./store/user')['useUserStore']
const useVModel: typeof import('@vueuse/core')['useVModel']
const useVModels: typeof import('@vueuse/core')['useVModels']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
@@ -242,4 +246,252 @@ declare global {
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever']
}
export {}
// for vue template auto import
declare module 'vue' {
interface ComponentCustomProperties {
$$: typeof import('vue/macros')['$$']
$: typeof import('vue/macros')['$']
$computed: typeof import('vue/macros')['$computed']
$customRef: typeof import('vue/macros')['$customRef']
$ref: typeof import('vue/macros')['$ref']
$shallowRef: typeof import('vue/macros')['$shallowRef']
$toRef: typeof import('vue/macros')['$toRef']
EffectScope: typeof import('vue')['EffectScope']
asyncComputed: typeof import('@vueuse/core')['asyncComputed']
autoResetRef: typeof import('@vueuse/core')['autoResetRef']
computed: typeof import('vue')['computed']
computedAsync: typeof import('@vueuse/core')['computedAsync']
computedEager: typeof import('@vueuse/core')['computedEager']
computedInject: typeof import('@vueuse/core')['computedInject']
computedWithControl: typeof import('@vueuse/core')['computedWithControl']
controlledComputed: typeof import('@vueuse/core')['controlledComputed']
controlledRef: typeof import('@vueuse/core')['controlledRef']
createApp: typeof import('vue')['createApp']
createEventHook: typeof import('@vueuse/core')['createEventHook']
createGlobalState: typeof import('@vueuse/core')['createGlobalState']
createInjectionState: typeof import('@vueuse/core')['createInjectionState']
createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
customRef: typeof import('vue')['customRef']
debouncedRef: typeof import('@vueuse/core')['debouncedRef']
debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
defineComponent: typeof import('vue')['defineComponent']
eagerComputed: typeof import('@vueuse/core')['eagerComputed']
effectScope: typeof import('vue')['effectScope']
extendRef: typeof import('@vueuse/core')['extendRef']
getCurrentInstance: typeof import('vue')['getCurrentInstance']
getCurrentScope: typeof import('vue')['getCurrentScope']
h: typeof import('vue')['h']
ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
inject: typeof import('vue')['inject']
isDark: typeof import('./composables/dark')['isDark']
isDefined: typeof import('@vueuse/core')['isDefined']
isReadonly: typeof import('vue')['isReadonly']
isRef: typeof import('vue')['isRef']
logicAnd: typeof import('@vueuse/core')['logicAnd']
logicNot: typeof import('@vueuse/core')['logicNot']
logicOr: typeof import('@vueuse/core')['logicOr']
makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
markRaw: typeof import('vue')['markRaw']
nextTick: typeof import('vue')['nextTick']
onActivated: typeof import('vue')['onActivated']
onBeforeMount: typeof import('vue')['onBeforeMount']
onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
onClickOutside: typeof import('@vueuse/core')['onClickOutside']
onDeactivated: typeof import('vue')['onDeactivated']
onErrorCaptured: typeof import('vue')['onErrorCaptured']
onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
onLongPress: typeof import('@vueuse/core')['onLongPress']
onMounted: typeof import('vue')['onMounted']
onRenderTracked: typeof import('vue')['onRenderTracked']
onRenderTriggered: typeof import('vue')['onRenderTriggered']
onScopeDispose: typeof import('vue')['onScopeDispose']
onServerPrefetch: typeof import('vue')['onServerPrefetch']
onStartTyping: typeof import('@vueuse/core')['onStartTyping']
onUnmounted: typeof import('vue')['onUnmounted']
onUpdated: typeof import('vue')['onUpdated']
pausableWatch: typeof import('@vueuse/core')['pausableWatch']
preferredDark: typeof import('./composables/dark')['preferredDark']
provide: typeof import('vue')['provide']
reactify: typeof import('@vueuse/core')['reactify']
reactifyObject: typeof import('@vueuse/core')['reactifyObject']
reactive: typeof import('vue')['reactive']
reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
reactivePick: typeof import('@vueuse/core')['reactivePick']
readonly: typeof import('vue')['readonly']
ref: typeof import('vue')['ref']
refAutoReset: typeof import('@vueuse/core')['refAutoReset']
refDebounced: typeof import('@vueuse/core')['refDebounced']
refDefault: typeof import('@vueuse/core')['refDefault']
refThrottled: typeof import('@vueuse/core')['refThrottled']
refWithControl: typeof import('@vueuse/core')['refWithControl']
resolveComponent: typeof import('vue')['resolveComponent']
shallowReactive: typeof import('vue')['shallowReactive']
shallowReadonly: typeof import('vue')['shallowReadonly']
shallowRef: typeof import('vue')['shallowRef']
syncRef: typeof import('@vueuse/core')['syncRef']
syncRefs: typeof import('@vueuse/core')['syncRefs']
templateRef: typeof import('@vueuse/core')['templateRef']
throttledRef: typeof import('@vueuse/core')['throttledRef']
throttledWatch: typeof import('@vueuse/core')['throttledWatch']
toRaw: typeof import('vue')['toRaw']
toReactive: typeof import('@vueuse/core')['toReactive']
toRef: typeof import('vue')['toRef']
toRefs: typeof import('vue')['toRefs']
toggleDark: typeof import('./composables/dark')['toggleDark']
triggerRef: typeof import('vue')['triggerRef']
tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
unref: typeof import('vue')['unref']
unrefElement: typeof import('@vueuse/core')['unrefElement']
until: typeof import('@vueuse/core')['until']
useActiveElement: typeof import('@vueuse/core')['useActiveElement']
useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
useAsyncState: typeof import('@vueuse/core')['useAsyncState']
useAttrs: typeof import('vue')['useAttrs']
useBase64: typeof import('@vueuse/core')['useBase64']
useBattery: typeof import('@vueuse/core')['useBattery']
useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
useCached: typeof import('@vueuse/core')['useCached']
useClamp: typeof import('@vueuse/core')['useClamp']
useClipboard: typeof import('@vueuse/core')['useClipboard']
useColorMode: typeof import('@vueuse/core')['useColorMode']
useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
useCounter: typeof import('@vueuse/core')['useCounter']
useCssModule: typeof import('vue')['useCssModule']
useCssVar: typeof import('@vueuse/core')['useCssVar']
useCssVars: typeof import('vue')['useCssVars']
useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
useCycleList: typeof import('@vueuse/core')['useCycleList']
useDark: typeof import('@vueuse/core')['useDark']
useDateFormat: typeof import('@vueuse/core')['useDateFormat']
useDebounce: typeof import('@vueuse/core')['useDebounce']
useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
useDevicesList: typeof import('@vueuse/core')['useDevicesList']
useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
useDraggable: typeof import('@vueuse/core')['useDraggable']
useElementBounding: typeof import('@vueuse/core')['useElementBounding']
useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
useElementHover: typeof import('@vueuse/core')['useElementHover']
useElementSize: typeof import('@vueuse/core')['useElementSize']
useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
useEventBus: typeof import('@vueuse/core')['useEventBus']
useEventListener: typeof import('@vueuse/core')['useEventListener']
useEventSource: typeof import('@vueuse/core')['useEventSource']
useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
useFavicon: typeof import('@vueuse/core')['useFavicon']
useFetch: typeof import('@vueuse/core')['useFetch']
useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
useFocus: typeof import('@vueuse/core')['useFocus']
useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
useFps: typeof import('@vueuse/core')['useFps']
useFullscreen: typeof import('@vueuse/core')['useFullscreen']
useGamepad: typeof import('@vueuse/core')['useGamepad']
useGeolocation: typeof import('@vueuse/core')['useGeolocation']
useHead: typeof import('@vueuse/head')['useHead']
useI18n: typeof import('vue-i18n')['useI18n']
useIdle: typeof import('@vueuse/core')['useIdle']
useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
useInterval: typeof import('@vueuse/core')['useInterval']
useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
useLastChanged: typeof import('@vueuse/core')['useLastChanged']
useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
useMediaControls: typeof import('@vueuse/core')['useMediaControls']
useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
useMemoize: typeof import('@vueuse/core')['useMemoize']
useMemory: typeof import('@vueuse/core')['useMemory']
useMounted: typeof import('@vueuse/core')['useMounted']
useMouse: typeof import('@vueuse/core')['useMouse']
useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
useMousePressed: typeof import('@vueuse/core')['useMousePressed']
useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
useNetwork: typeof import('@vueuse/core')['useNetwork']
useNow: typeof import('@vueuse/core')['useNow']
useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
useOnline: typeof import('@vueuse/core')['useOnline']
usePageLeave: typeof import('@vueuse/core')['usePageLeave']
useParallax: typeof import('@vueuse/core')['useParallax']
usePermission: typeof import('@vueuse/core')['usePermission']
usePointer: typeof import('@vueuse/core')['usePointer']
usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
useRafFn: typeof import('@vueuse/core')['useRafFn']
useRefHistory: typeof import('@vueuse/core')['useRefHistory']
useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
useRoute: typeof import('vue-router')['useRoute']
useRouter: typeof import('vue-router')['useRouter']
useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
useScriptTag: typeof import('@vueuse/core')['useScriptTag']
useScroll: typeof import('@vueuse/core')['useScroll']
useScrollLock: typeof import('@vueuse/core')['useScrollLock']
useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
useShare: typeof import('@vueuse/core')['useShare']
useSlots: typeof import('vue')['useSlots']
useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
useStorage: typeof import('@vueuse/core')['useStorage']
useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
useStyleTag: typeof import('@vueuse/core')['useStyleTag']
useSwipe: typeof import('@vueuse/core')['useSwipe']
useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
useTextSelection: typeof import('@vueuse/core')['useTextSelection']
useThrottle: typeof import('@vueuse/core')['useThrottle']
useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
useTimeout: typeof import('@vueuse/core')['useTimeout']
useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
useTimestamp: typeof import('@vueuse/core')['useTimestamp']
useTitle: typeof import('@vueuse/core')['useTitle']
useToggle: typeof import('@vueuse/core')['useToggle']
useTransition: typeof import('@vueuse/core')['useTransition']
useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
useUserMedia: typeof import('@vueuse/core')['useUserMedia']
useUserStore: typeof import('./store/user')['useUserStore']
useVModel: typeof import('@vueuse/core')['useVModel']
useVModels: typeof import('@vueuse/core')['useVModels']
useVibrate: typeof import('@vueuse/core')['useVibrate']
useVirtualList: typeof import('@vueuse/core')['useVirtualList']
useWakeLock: typeof import('@vueuse/core')['useWakeLock']
useWebNotification: typeof import('@vueuse/core')['useWebNotification']
useWebSocket: typeof import('@vueuse/core')['useWebSocket']
useWebWorker: typeof import('@vueuse/core')['useWebWorker']
useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
useWindowSize: typeof import('@vueuse/core')['useWindowSize']
watch: typeof import('vue')['watch']
watchAtMost: typeof import('@vueuse/core')['watchAtMost']
watchDebounced: typeof import('@vueuse/core')['watchDebounced']
watchEffect: typeof import('vue')['watchEffect']
watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
watchOnce: typeof import('@vueuse/core')['watchOnce']
watchPausable: typeof import('@vueuse/core')['watchPausable']
watchThrottled: typeof import('@vueuse/core')['watchThrottled']
watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
whenever: typeof import('@vueuse/core')['whenever']
}
}
+1 -3
View File
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { toggleDark } from '~/composables'
const { t, availableLocales, locale } = useI18n()
const toggleLocales = () => {
@@ -20,7 +18,7 @@ const toggleLocales = () => {
<div i="carbon-sun dark:carbon-moon" />
</button>
<a class="icon-btn mx-2" :title="t('button.toggle_langs')" @click="toggleLocales">
<a class="icon-btn mx-2" :title="t('button.toggle_langs')" @click="toggleLocales()">
<div i-carbon-language />
</a>
-2
View File
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { useUserStore } from '~/stores/user'
const props = defineProps<{ name: string }>()
const router = useRouter()
const user = useUserStore()
-2
View File
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { useUserStore } from '~/stores/user'
const user = useUserStore()
const name = $ref(user.savedName)
File renamed without changes.