修改自适应
This commit is contained in:
@@ -741,32 +741,134 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 手机端适配:统计卡片一行 2 个、标题区截断、卡片高度自适应、按钮点击区域 ≥40px
|
||||
@media (max-width: 768px) {
|
||||
.welcome-section {
|
||||
padding: 24px 16px;
|
||||
.dashboard {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.welcome-title {
|
||||
font-size: 24px;
|
||||
// 欢迎区:缩小 padding 与字号,长文本截断
|
||||
.welcome-section {
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
border-radius: 8px;
|
||||
|
||||
.welcome-content {
|
||||
min-width: 0;
|
||||
|
||||
.welcome-title {
|
||||
margin: 0 0 6px;
|
||||
font-size: 20px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.welcome-subtitle {
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 统计卡片一行 2 个,间距缩小
|
||||
.stats-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
padding: 16px;
|
||||
padding: 12px;
|
||||
gap: 10px;
|
||||
border-radius: 8px;
|
||||
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
.stat-icon-wrapper {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
|
||||
.el-icon {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
.stat-value {
|
||||
font-size: 18px;
|
||||
margin-bottom: 4px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
// 趋势徐章移到卡片右上角,避免挤压数值区
|
||||
.stat-trend {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
font-size: 11px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.stats-grid {
|
||||
grid-template-columns: 1fr;
|
||||
// 列表卡片:缩小内边距与标题字号,高度改自适应防止溢出
|
||||
.lists-section {
|
||||
gap: 12px;
|
||||
|
||||
.list-card {
|
||||
padding: 16px;
|
||||
border-radius: 8px;
|
||||
|
||||
.card-header {
|
||||
margin-bottom: 12px;
|
||||
|
||||
.card-title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
// 按钮点击区域 ≥40px
|
||||
:deep(.el-button) {
|
||||
min-height: 40px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.list-content {
|
||||
// 手机端适当减小最小高度(桌面端 400px),高度自适应防止溢出
|
||||
min-height: 200px;
|
||||
|
||||
// 触屏上禁用 hover 负 margin 外扩效果,避免布局异常
|
||||
.task-item,
|
||||
.activity-item {
|
||||
&:hover {
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 分页按钮点击区域 ≥40px
|
||||
.pagination-wrapper {
|
||||
:deep(.el-pager li),
|
||||
:deep(.el-pagination button) {
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user