20260728225443

This commit is contained in:
oneao committed 2026-07-28 22:54:43 +08:00
1 parent 5ec7aadef9
commit f6b79ea09a
30 files changed
+1541 -1120

No files matched your search

@@ -146,6 +146,16 @@ const dragRowColumn = {
resizable: false,
};
function getHeaderAlign(column) {
if (column.headerAlign) return column.headerAlign;
if (isSelectionColumn(column)) return "center";
if (column.dataIndex === "actions") return "center";
if (column.actions && column.actions.length) return "center";
if (column.checkbox === true) return "center";
if (column.editor && column.editor.type === "checkbox") return "center";
return "left";
}
const displayColumns = computed(() => {
const cols = props.columns.map((col) => resolveCustomCell(col, editingCtx));
if (props.rowDraggable) cols.unshift(dragRowColumn);
@@ -160,7 +170,10 @@ const displayColumns = computed(() => {
resizable: false,
});
}
return cols;
return cols.map((column) => ({
...column,
headerAlign: getHeaderAlign(column),
}));
});
// 剥离内部列(选择列、序号列、拖拽列)后回传,避免污染父组件 columns