fix: GrTable 移动端去除 fixed 方向 (主列+操作列不再 fixed)
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
<component
|
||||
:is="child"
|
||||
v-if="shouldRenderColumn(child, idx)"
|
||||
:fixed="resolveFixed(child)"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
@@ -143,6 +144,13 @@ function shouldRenderColumn(node, idx) {
|
||||
return mainColsResolved.value.includes(meta.prop) // 只渲染主列
|
||||
}
|
||||
|
||||
// 移动端移除 fixed 方向 (桌面仍保留 fixed-left/right 横滚体验)
|
||||
function resolveFixed(node) {
|
||||
if (!isMobile.value) return node.props?.fixed
|
||||
// 移动端: el-table 在窄屏基本只剩 3-5 列, 不再需要列固定 (会撑出滚动容器)
|
||||
return undefined
|
||||
}
|
||||
|
||||
// 透传 el-table 引用方法 (clearSelection / toggleRowSelection 等)
|
||||
defineExpose({
|
||||
clearSelection: (...args) => tableRef.value?.clearSelection?.(...args),
|
||||
|
||||
Reference in New Issue
Block a user