From 0fe6e762051f3f290e568d7487b40696fb319de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=B6=85?= Date: Mon, 7 Apr 2025 14:53:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=BD=E5=B1=8F?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8Btabbar=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E8=B6=85=E5=AE=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.ts | 6 ++++ postcss.config.ts | 3 +- src/layout/components/Tabbar.vue | 48 +++++++++++++++++++++----------- src/layout/index.vue | 2 +- tsconfig.json | 1 + types/auto/components.d.ts | 8 ------ vite.config.ts | 2 ++ 7 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 config/index.ts diff --git a/config/index.ts b/config/index.ts new file mode 100644 index 0000000..0a22c6c --- /dev/null +++ b/config/index.ts @@ -0,0 +1,6 @@ +interface IConfig { + primaryWidth: number +} +export const config: IConfig = { + primaryWidth: 750 +} diff --git a/postcss.config.ts b/postcss.config.ts index ffe0dcb..a9d1134 100644 --- a/postcss.config.ts +++ b/postcss.config.ts @@ -1,3 +1,4 @@ +import { config } from "./config/index" // 修改配置后重启服务生效 export default { plugins: { @@ -8,7 +9,7 @@ export default { // UI 设计稿宽度 viewportWidth: (file: string) => file.includes("vant") ? 375 : 375, // 限制视图的最大宽度 - maxDisplayWidth: 750, + maxDisplayWidth: config.primaryWidth, // 页面最外层选择器 appSelector: "#app", // 是否对「页面最外层选择器」对应的元素进行描边 diff --git a/src/layout/components/Tabbar.vue b/src/layout/components/Tabbar.vue index f3c6493..222238b 100644 --- a/src/layout/components/Tabbar.vue +++ b/src/layout/components/Tabbar.vue @@ -1,6 +1,8 @@ + + diff --git a/src/layout/index.vue b/src/layout/index.vue index d552e42..6d55434 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -18,7 +18,7 @@ const showFooter = computed(() => route.meta.layout?.footer)