@8base-react/crud 中文文档教程

发布于 3年前 浏览 24 项目主页 更新于 3年前

8base CRUD

8base CRUD 是 react-apollo 组件下的包装器,用于简化 crud 操作的工作。

API

Table of Contents

RecordsList

Extends Component

获取表格内容的

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreate

组件 Extends Component

创建表格记录的

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreateMany

组件 Extends Component

创建表格多条记录的组件

Properties

  • tableName string Name of the table
  • tableId string Id of the table

ChildrenPropObject

Results记录更新查询和变异

Properties

RecordUpdate

Extends Component

更新表记录的

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

RecordDelete

组件 Extends Component

删除表记录的组件

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

Usage

  <RecordsList
    applicationName={ applicationName }
    tableName="someTableName"
    variables={ options.variables }
  >
    { ({ data, loading }) => (<div>{data}</div>) }
  </RecordsList>     
   <RecordUpdate
    tableId="table-id"
    recordId="42"
    onCompleted={ () => {
      ...
    } }
  >
    { (onSubmit, { tableMetaResult, recordDataResult, fetchingLoading }) => (
      <FormComponent initialValues={ recordDataResult.data } onSubmit={ onSubmit } />
    ) }
  </RecordUpdate>

8base CRUD

8base CRUD is a wrapper under the react-apollo component to simplify working with the crud operations.

API

Table of Contents

RecordsList

Extends Component

Component for fetching the table content

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreate

Extends Component

Component for creating the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table

RecordCreateMany

Extends Component

Component for creating many records of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table

ChildrenPropObject

Results of the record update queries and mutation

Properties

RecordUpdate

Extends Component

Component for updating the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

RecordDelete

Extends Component

Component for deleting the record of the table

Properties

  • tableName string Name of the table
  • tableId string Id of the table
  • recordId string Id of the record

Usage

  <RecordsList
    applicationName={ applicationName }
    tableName="someTableName"
    variables={ options.variables }
  >
    { ({ data, loading }) => (<div>{data}</div>) }
  </RecordsList>     
   <RecordUpdate
    tableId="table-id"
    recordId="42"
    onCompleted={ () => {
      ...
    } }
  >
    { (onSubmit, { tableMetaResult, recordDataResult, fetchingLoading }) => (
      <FormComponent initialValues={ recordDataResult.data } onSubmit={ onSubmit } />
    ) }
  </RecordUpdate>
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文