fix: default checkbox for row selection type

This commit is contained in:
chenos 2021-01-01 17:42:24 +08:00
parent 97136c62ba
commit 53212ee47d
2 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ export function SimpleTable(props: SimpleTableProps) {
associatedKey,
isFieldComponent,
onSelected,
multiple = true,
selectedRowKeys: srk,
} = props;
const { rowKey = 'id', name: viewName, actionDefaultParams = {}, fields = [], rowViewName, actions = [], paginated = true, defaultPerPage = 10 } = schema;
@ -78,6 +79,7 @@ export function SimpleTable(props: SimpleTableProps) {
const tableProps: any = {};
if (actions.length) {
tableProps.rowSelection = {
type: multiple ? 'checkbox' : 'radio',
selectedRowKeys,
onChange,
}

View File

@ -27,7 +27,7 @@ export function Table(props: TableProps) {
associatedKey,
isFieldComponent,
onSelected,
multiple,
multiple = true,
selectedRowKeys: srk,
} = props;
const { name: viewName, fields, actionDefaultParams = {}, defaultTabName, rowKey = 'id', actions = [], paginated = true, defaultPerPage = 10 } = schema;