tachybase_todo/packages/client/src/schema-component/antd/row-selection/index.md
chenos f9a18863ad
feat: table related components (#172)
* table-related components

* feat: ArrayTable & VoidTable & RowSelection

* update

* fix: missing request params

* fix(client): get sideMenuRef from context

* void table

* fix: use request params merge

* demo

* void table demo

* feat: improve code

* feat: improve code

* feat: row select table

* feat: record picker
2022-01-28 09:28:01 +08:00

1.5 KiB

nav group
path
/client
path
/schema-components

RowSelection - 行选择器 待定

用表格视图展示可选项数据,功能上与 Radio.Group 和 CheckBox.Group 一致。

JSON Schema

rowSelection

单选

{
  type: 'number',
  'x-component': 'RowSelection',
  'x-component-props': {
    rowKey: 'id',
    rowSelection: {
      type: 'radio',
    },
    dataSource: [
      { id: 1, name: 'Name1' },
      { id: 2, name: 'Name2' },
      { id: 3, name: 'Name3' },
    ],
  },
  default: 1,
  properties: {
    column1: {
      type: 'void',
      'x-component': 'VoidTable.Column',
      'x-component-props': {
        title: 'Name',
      },
      properties: {
        name: {
          type: 'string',
          'x-component': 'Input',
        },
      },
    },
  },
}

多选

{
  type: 'number',
  'x-component': 'RowSelection',
  'x-component-props': {
    rowKey: 'id',
    rowSelection: {
      type: 'radio',
    },
    dataSource: [
      { id: 1, name: 'Name1' },
      { id: 2, name: 'Name2' },
      { id: 3, name: 'Name3' },
    ],
  },
  default: 1,
  properties: {
    column1: {
      type: 'void',
      'x-component': 'VoidTable.Column',
      'x-component-props': {
        title: 'Name',
      },
      properties: {
        name: {
          type: 'string',
          'x-component': 'Input',
        },
      },
    },
  },
}

Examples