fix: GrTable 移动端保留操作列 fixed="right"

This commit is contained in:
guoju0808
2026-08-26 11:35:10 +00:00
parent 4de6479be0
commit 31b3fb504a
+6 -3
View File
@@ -144,11 +144,14 @@ function shouldRenderColumn(node, idx) {
return mainColsResolved.value.includes(meta.prop) // 只渲染主列
}
// 移动端移除 fixed 方向 (桌面仍保留 fixed-left/right 横滚体验)
// 移动端: 主列(有 prop) 不再 fixed, 但操作列 (label="操作" 且无 prop) 保留 fixed="right"
// 这样操作始终可见, 即使主列需要横滚也能点到
function resolveFixed(node) {
if (!isMobile.value) return node.props?.fixed
// 移动端: el-table 在窄屏基本只剩 3-5 列, 不再需要列固定 (会撑出滚动容器)
return undefined
// 移动端, 主数据列 (有 prop) 去掉 fixed
if (node.props?.prop) return undefined
// 操作列 / 自定义 slot 列: 保留原 fixed (一般是 fixed="right")
return node.props?.fixed
}
// 透传 el-table 引用方法 (clearSelection / toggleRowSelection 等)