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