From 3e99ad148388165ae24ac2cd57b2d9de243c393f Mon Sep 17 00:00:00 2001 From: Junyi Date: Fri, 22 Dec 2023 15:00:54 +0800 Subject: [PATCH] refactor(client): allow fixed layout table and action link class (#3246) --- .../client/src/schema-component/antd/action/Action.Link.tsx | 5 ++++- .../core/client/src/schema-component/antd/table-v2/Table.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/action/Action.Link.tsx b/packages/core/client/src/schema-component/antd/action/Action.Link.tsx index 3843e17ef..84a9253d9 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Link.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Link.tsx @@ -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 ; + return ( + + ); }, { displayName: 'ActionLink' }, ); diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx index d458ac5dd..d9116be2e 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx @@ -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={{