fix: 修复移动端横向滚动条问题

- 全局为 html/body 添加 overflow-x: clip 兜底(不影响 sticky 定位)
- 全局 img 与 cropper 容器限制最大宽度,大图在窄屏不再撑破布局
- URL 构造的参数编辑行在移动端改为纵向堆叠
- 时间戳页日期选择器窄屏占满可用宽度
- 首页标签行允许换行,避免超窄屏溢出
This commit is contained in:
夏犀麟 2026-08-21 14:58:44 +08:00
parent d53c5e8870
commit c0bf3ad3cf
4 changed files with 38 additions and 0 deletions

View File

@ -19,6 +19,32 @@ body,
padding: 0; padding: 0;
} }
/* ---------- 移动端防横向滚动 ----------
* 个别组件如裁剪容器按图片原始宽度渲染日期选择器固定宽度
* 在窄屏下会撑出横向滚动条此处做全局兜底
* overflow-x: clip 不会产生滚动容器因此不影响 sticky 定位元素 */
html,
body {
overflow-x: hidden;
}
@supports (overflow: clip) {
html,
body {
overflow-x: clip;
}
}
/* 图片通用约束(与 cropperjs 官方示例一致):上传的图片预览不超出容器 */
img {
display: block;
max-width: 100%;
}
/* Cropper 容器宽度不超过视口,避免大图在移动端撑破布局 */
.cropper-container {
max-width: 100%;
}
body { body {
font-family: font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',

View File

@ -60,6 +60,7 @@ import { tools } from '@/router/tools'
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 8px; gap: 8px;
flex-wrap: wrap;
} }
/* 工具卡片栅格:响应式,移动端单列 */ /* 工具卡片栅格:响应式,移动端单列 */

View File

@ -216,4 +216,9 @@ function onHistorySelect(text: string) {
margin-top: 16px; margin-top: 16px;
flex-wrap: wrap; flex-wrap: wrap;
} }
/* 日期选择器:窄屏下占满可用宽度,避免固定宽度撑出横向滚动条 */
:deep(.t-date-picker) {
width: 100%;
max-width: 340px;
}
</style> </style>

View File

@ -281,6 +281,12 @@ function onHistorySelect(text: string) {
gap: 8px; gap: 8px;
margin-bottom: 8px; margin-bottom: 8px;
} }
/* 移动端:参数编辑行改为纵向堆叠,避免输入框并排撑出横向滚动 */
@media (max-width: 767px) {
.param-edit-row {
flex-direction: column;
}
}
.param-input { .param-input {
flex: 1; flex: 1;
} }