@8base/crud 中文文档教程
8base CRUD
8base CRUD 是 react-apollo 组件下的包装器,用于简化 crud 操作的工作。
API
Table of Contents
RecordsList
Extends Component
获取表格内容的
Properties
RecordCreate
组件 Extends Component
创建表格记录的
Properties
RecordCreateMany
组件 Extends Component
创建表格多条记录的组件
Properties
ChildrenPropObject
Results记录更新查询和变异
Properties
RecordUpdate
Extends Component
更新表记录的
Properties
RecordDelete
组件 Extends Component
删除表记录的组件
Properties
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
RecordCreate
Extends Component
Component for creating the record of the table
Properties
RecordCreateMany
Extends Component
Component for creating many records of the table
Properties
ChildrenPropObject
Results of the record update queries and mutation
Properties
RecordUpdate
Extends Component
Component for updating the record of the table
Properties
RecordDelete
Extends Component
Component for deleting the record of the table
Properties
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>
更多