From 8fd06e206af6f4bcfdce1098b1fce5bc2379b3ab Mon Sep 17 00:00:00 2001 From: zc <425734130@qq.com> Date: Thu, 28 Aug 2025 06:51:56 +0800 Subject: [PATCH] feat: cache --- src/assets/base.scss | 9 +++ src/auto-import.d.ts | 78 +++++++++++++++++++ .../components/info-table.vue | 18 +++++ .../components/review-single.vue | 25 ++++++ src/views/commodity-detail/index.vue | 67 ++++++++++++++-- vite.config.ts | 8 ++ 6 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 src/auto-import.d.ts create mode 100644 src/views/commodity-detail/components/info-table.vue create mode 100644 src/views/commodity-detail/components/review-single.vue diff --git a/src/assets/base.scss b/src/assets/base.scss index 2cf0020..81971dc 100644 --- a/src/assets/base.scss +++ b/src/assets/base.scss @@ -1,3 +1,12 @@ body{ font-size: .12rem; +} +*{ + margin: 0; padding: 0; +} +ul,dl{ + list-style: none; +} +h1,h2,h3,h4,h5,h6, b{ + font-weight: normal; } \ No newline at end of file diff --git a/src/auto-import.d.ts b/src/auto-import.d.ts new file mode 100644 index 0000000..cb86568 --- /dev/null +++ b/src/auto-import.d.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +// biome-ignore lint: disable +export {} +declare global { + const EffectScope: typeof import('vue')['EffectScope'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const customRef: typeof import('vue')['customRef'] + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const effectScope: typeof import('vue')['effectScope'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const getCurrentWatcher: typeof import('vue')['getCurrentWatcher'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isProxy: typeof import('vue')['isProxy'] + const isReactive: typeof import('vue')['isReactive'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const isShallow: typeof import('vue')['isShallow'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] + const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const toValue: typeof import('vue')['toValue'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useId: typeof import('vue')['useId'] + const useLink: typeof import('vue-router')['useLink'] + const useModel: typeof import('vue')['useModel'] + const useRoute: typeof import('vue-router')['useRoute'] + const useRouter: typeof import('vue-router')['useRouter'] + const useSlots: typeof import('vue')['useSlots'] + const useTemplateRef: typeof import('vue')['useTemplateRef'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] + const watchPostEffect: typeof import('vue')['watchPostEffect'] + const watchSyncEffect: typeof import('vue')['watchSyncEffect'] +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + import('vue') +} diff --git a/src/views/commodity-detail/components/info-table.vue b/src/views/commodity-detail/components/info-table.vue new file mode 100644 index 0000000..36fb06c --- /dev/null +++ b/src/views/commodity-detail/components/info-table.vue @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/src/views/commodity-detail/components/review-single.vue b/src/views/commodity-detail/components/review-single.vue new file mode 100644 index 0000000..fa704e1 --- /dev/null +++ b/src/views/commodity-detail/components/review-single.vue @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file diff --git a/src/views/commodity-detail/index.vue b/src/views/commodity-detail/index.vue index 9de119e..084d506 100644 --- a/src/views/commodity-detail/index.vue +++ b/src/views/commodity-detail/index.vue @@ -1,30 +1,83 @@ \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index c6f4bcf..25afbfb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,7 @@ import UnoCSS from 'unocss/vite' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import AutoImport from 'unplugin-auto-import/vite' import vueDevTools from 'vite-plugin-vue-devtools' // https://vite.dev/config/ @@ -11,6 +12,13 @@ export default defineConfig({ UnoCSS(), vue(), vueDevTools(), + AutoImport({ + imports: [ + 'vue', + 'vue-router', + ], + dts: 'src/auto-import.d.ts' + }), ], resolve: { alias: {