Commit 3c8bd21d by chenwq1

feat: 更新样式与布局以提升用户体验

- 在 postcss.config.ts 中将 #app 添加到 selectorBlackList,确保 px 不被转为 rem
- 在 reset.scss 中为 #app 添加最大宽度和背景样式,优化页面布局
- 在 index.vue 中调整布局样式,确保 RouterView 占满剩余空间并使 tabbar 固定在底部
1 parent 08c802d7
Pipeline #71 for 3c8bd21d failed in 0 seconds
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
propList: ["*"], propList: ["*"],
unitPrecision: 5, unitPrecision: 5,
minPixelValue: 1, minPixelValue: 1,
selectorBlackList: [".ignore", "html"], selectorBlackList: [".ignore", "html", "#app"],
}), }),
], ],
}; };
......
...@@ -24,6 +24,16 @@ body { ...@@ -24,6 +24,16 @@ body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
// ===== 最大宽度限制(超过 430px 居中显示,手机端正常自适应)=====
// #app 已加入 postcss-pxtorem selectorBlackList,px 不会被转 rem
#app {
max-width: 430px;
min-height: 100vh;
margin: 0 auto;
position: relative;
background-color: #f7f8fa;
}
a { a {
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
......
...@@ -45,10 +45,8 @@ function onTabChange(index: number) { ...@@ -45,10 +45,8 @@ function onTabChange(index: number) {
<van-tabbar v-if="showTabBar" <van-tabbar v-if="showTabBar"
active-color="var(--color-primary)" active-color="var(--color-primary)"
fixed
inactive-color="#7d7e80" inactive-color="#7d7e80"
:model-value="activeTab" :model-value="activeTab"
placeholder
safe-area-inset-bottom safe-area-inset-bottom
@change="onTabChange"> @change="onTabChange">
<van-tabbar-item v-for="tab in tabList" <van-tabbar-item v-for="tab in tabList"
...@@ -62,9 +60,18 @@ function onTabChange(index: number) { ...@@ -62,9 +60,18 @@ function onTabChange(index: number) {
<style lang="scss" scoped> <style lang="scss" scoped>
.layout-default { .layout-default {
display: flex;
flex-direction: column;
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background-color: var(--color-bg-page); background-color: var(--color-bg-page);
// 让 RouterView 内容区占满剩余空间,tabbar 自然沉底
:deep(.van-tabbar) {
position: sticky;
bottom: 0;
width: 100%;
}
} }
.fade-enter-active, .fade-enter-active,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!