Merge pull request #35 from maxbad/v2.0

BasicTable组件中actionColumn的fixed属性判断
This commit is contained in:
孟帅 2023-06-12 10:39:53 +08:00 committed by GitHub
commit 9ec736f0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,10 +92,17 @@ export function useColumns(propsRef: ComputedRef<BasicTableProps>) {
function handleActionColumn(propsRef: ComputedRef<BasicTableProps>, columns: BasicColumn[]) { function handleActionColumn(propsRef: ComputedRef<BasicTableProps>, columns: BasicColumn[]) {
const { actionColumn } = unref(propsRef); const { actionColumn } = unref(propsRef);
if (!actionColumn) return; if (!actionColumn) return;
!columns.find((col) => col.key === 'action') && if (!columns.find((col) => col.key === 'action')) {
columns.push({ if ((actionColumn as any).fixed && (actionColumn as any).fixed === 'left') {
...(actionColumn as any), columns.unshift({
}); ...(actionColumn as any),
});
} else {
columns.push({
...(actionColumn as any),
});
}
}
} }
//设置 //设置