From 680575925c9f1eb75e31de24d330f79dbf7bf95f Mon Sep 17 00:00:00 2001 From: Shu Guang <61069967+shuguangnet@users.noreply.github.com> Date: Sat, 17 May 2025 21:16:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9Layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/GlobalLayout.vue | 20 ++++++++++++++++++-- src/views/communtiy/Article.vue | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/layouts/GlobalLayout.vue b/src/layouts/GlobalLayout.vue index 7f5924de..e00d1b89 100644 --- a/src/layouts/GlobalLayout.vue +++ b/src/layouts/GlobalLayout.vue @@ -204,10 +204,26 @@ export default { margin: 24px; padding: 24px; background: #fff; - height: 100vh; + min-height: calc(100vh - 128px); // 移除固定height border-radius: 8px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05); - min-height: calc(100vh - 128px); + display: flex; // 添加flex布局 + flex-direction: column; // 垂直方向排列 + flex: 1; // 占用剩余空间 + overflow: auto; // 内容过多时显示滚动条 +} + +// 添加布局容器样式 +.ant-pro-basicLayout { + min-height: 100vh; + display: flex; + flex-direction: column; +} + +.ant-pro-basicLayout-content-wrapper { + flex: 1; + display: flex; + flex-direction: column; } .footer-container { diff --git a/src/views/communtiy/Article.vue b/src/views/communtiy/Article.vue index 1c74f06c..99bf7cd8 100644 --- a/src/views/communtiy/Article.vue +++ b/src/views/communtiy/Article.vue @@ -111,7 +111,7 @@ export default { userData: [], imageUrlRegex: /(http[s]?:\/\/[^(\s|")]+\.(png|jpg|jpeg|gif|webp))/gi, current: 1, - pageSize: 8, + pageSize: 4, loading: true, loadingMore: false, data: [], @@ -146,7 +146,7 @@ export default { pageSize: this.pageSize, total: this.total, showSizeChanger: true, - pageSizeOptions: ["8", "9", "10", "20"], + pageSizeOptions: ["4", "8", "10", "20"], showQuickJumper: true, showTotal: (total) => `Total ${total} items`, onChange: this.changePage,