Skip to content

Commit

Permalink
refactor: request (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolking committed Jul 15, 2023
1 parent 4097740 commit cdf5bc1
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 277 deletions.
5 changes: 4 additions & 1 deletion .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"useArrayFilter": true,
"useArrayFind": true,
"useArrayFindIndex": true,
"useArrayFindLast": true,
"useArrayJoin": true,
"useArrayMap": true,
"useArrayReduce": true,
Expand Down Expand Up @@ -177,7 +178,6 @@
"useDebounceFn": true,
"useDebouncedRefHistory": true,
"useDelete": true,
"useDeleteItem": true,
"useDetail": true,
"useDeviceMotion": true,
"useDeviceOrientation": true,
Expand Down Expand Up @@ -241,16 +241,19 @@
"useParallax": true,
"usePermission": true,
"usePointer": true,
"usePointerLock": true,
"usePointerSwipe": true,
"usePost": true,
"usePreferredColorScheme": true,
"usePreferredContrast": true,
"usePreferredDark": true,
"usePreferredLanguages": true,
"usePreferredReducedMotion": true,
"usePrevious": true,
"usePut": true,
"useRafFn": true,
"useRefHistory": true,
"useRemove": true,
"useResizeObserver": true,
"useRoute": true,
"useRouter": true,
Expand Down
11 changes: 7 additions & 4 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ declare global {
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
Expand Down Expand Up @@ -178,8 +179,7 @@ declare global {
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDelete: typeof import('./src/composables/request')['useDelete']
const useDeleteItem: typeof import('./src/composables/crud')['useDeleteItem']
const useDetail: typeof import('./src/composables/crud')['useDetail']
const useDetail: typeof import('./src/composables/detail')['useDetail']
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
Expand All @@ -203,7 +203,7 @@ declare global {
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useForm: typeof import('./src/composables/crud')['useForm']
const useForm: typeof import('./src/composables/form')['useForm']
const useFps: typeof import('@vueuse/core')['useFps']
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
const useGamepad: typeof import('@vueuse/core')['useGamepad']
Expand All @@ -219,7 +219,7 @@ declare global {
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router')['useLink']
const useList: typeof import('./src/composables/crud')['useList']
const useList: typeof import('./src/composables/list')['useList']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
Expand All @@ -242,16 +242,19 @@ declare global {
const useParallax: typeof import('@vueuse/core')['useParallax']
const usePermission: typeof import('@vueuse/core')['usePermission']
const usePointer: typeof import('@vueuse/core')['usePointer']
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePost: typeof import('./src/composables/request')['usePost']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
const usePrevious: typeof import('@vueuse/core')['usePrevious']
const usePut: typeof import('./src/composables/request')['usePut']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useRemove: typeof import('./src/composables/remove')['useRemove']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
Expand Down
4 changes: 3 additions & 1 deletion src/composables/cates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function useCatesList() {
const list = useStorage<CatesItem[]>('CatesList', [])
const { data, execute } = useGet<{ list: CatesItem[] }>(Api.cates)

!list.value?.length && loadList()
tryOnMounted(() => {
!list.value?.length && loadList()
})

async function loadList() {
await execute()
Expand Down

0 comments on commit cdf5bc1

Please sign in to comment.