diff --git a/config/index.ts b/config/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a22c6c1774def806635cf2dd0bbd2f056dd843e --- /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 ffe0dcb5eadd1182312ad713e9560d8842fd7de0..a9d1134ad50292eed5149ea6a1c4e160a77c0bbd 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 f3c64934cedd5cb17017b7143d10aaa9a15b476b..222238bebe47f8fd00412d78f8d9069f7d474fc3 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 d552e42232c75223bf6dae0394cbeac59440f039..6d55434610383af66dbc0e70536d2540b4dce483 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -18,7 +18,7 @@ const showFooter = computed(() => route.meta.layout?.footer)