refactor(client): allow fixed layout table and action link class (#3246)

This commit is contained in:
Junyi 2023-12-22 15:00:54 +08:00 committed by GitHub
parent d570a2c704
commit 3e99ad1483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -1,11 +1,14 @@
import { observer } from '@formily/react';
import React from 'react';
import classnames from 'classnames';
import Action from './Action';
import { ComposedAction } from './types';
export const ActionLink: ComposedAction = observer(
(props: any) => {
return <Action {...props} component={props.component || 'a'} className={'nb-action-link'} />;
return (
<Action {...props} component={props.component || 'a'} className={classnames('nb-action-link', props.className)} />
);
},
{ displayName: 'ActionLink' },
);

View File

@ -538,6 +538,7 @@ export const Table: any = observer(
ref={tableSizeRefCallback}
rowKey={rowKey ?? defaultRowKey}
dataSource={dataSource}
tableLayout="auto"
{...others}
{...restProps}
pagination={paginationProps}
@ -547,7 +548,6 @@ export const Table: any = observer(
}}
onRow={onRow}
rowClassName={(record) => (selectedRow.includes(record[rowKey]) ? highlightRow : '')}
tableLayout={'auto'}
scroll={scroll}
columns={columns}
expandable={{