1 ProComponents 简单说明
1 特点
-----------------------------------------------------------------------------------------
1 ProComponents 组件基于 Ant Design [v4] 的封装 --> 形成功能, 更丰富更大的组件 (可高效开发, 但缺少灵活性)
2 Ant Design 或 ProComponents 文档说明, 和实际应用很多地方存在一定的差异性
3 注意有一部分是需要先单独安装依赖才可以使用的
-----------------------------------------------------------------------------------------
2 学习思路
-----------------------------------------------------------------------------------------
1 结合 ProComponents 项目文件 + 文档
2 要明确每个常用组件的 --> 作用 + 使用
3 要明确每个常用组件在常见的业务逻辑中 -> 通常扮演着什么样的角色
4 组件构成 --> 组件标签的 API 属性 [作用 + 使用]
5 组件之间的结合使用 + 功能的业务逻辑联动 + [ProComponents 和 Ant Design 共享API的特殊性]
-----------------------------------------------------------------------------------------
2 表单数据域
1 说明
-----------------------------------------------------------------------------------------
1 可以自动收集, 我们输入表单的数据, 放到一个对象中, 提供请求参数
2 Ant Design (v3) 中通过 --> Form.create() 高阶函数包装使用其内置的一些 API
3 Ant Design (v4) 中提供 --> 函数式组件 / 类组件 --> 俩种使用数据域的方式
4 Ant Design (v4) 中的 API 文档 --> Form 下面的 API 中 --> Form.Provider/FormInstance
5 ProComponents 也是可以看做是 Ant Design (v4) 来设置操作的,
------------------------------------------------------------------------------------------
2 函数式组件中:
------------------------------------------------------------------------------------------
const [form] = Form.useForm()
form.xxx()
------------------------------------------------------------------------------------------
3 类组件中 (使用方式和文档有一定的差异 !!!)
------------------------------------------------------------------------------------------
1 文档中 ↓
formRef = React.createRef<FormInstance>()
this.formRef.current!.resetFields()
2 实际使用中 ↓
import {createRef} from 'react'
actionRef = createRef()
formRef = createRef()
------------------------------------------------------------------------------------------
3 表单 Pro Form
1 说明
------------------------------------------------------------------------------------------
1 这个看着就是个狗东西
2 看着项目中的组件标签, 好像并没有直接去调用 ProFrom 组件, 反而是一些其他表单组件
------------------------------------------------------------------------------------------
2 DrawerForm
------------------------------------------------------------------------------------------
import { DrawerForm } from '@ant-design/pro-form'
<DrawerForm
title={}
visible={}
drawerProps={}
onFinish={}
initialValues={}
>
</DrawerForm>
------------------------------------------------------------------------------------------
4 表格 ProTable
1 说明
------------------------------------------------------------------------------------------
1 数据展示通常为 --> 列表 + 表格
2 表格又分为 --> 高级表格 + 可编辑表格 (居然可以在高级表格中使用 -- 可编辑表格的标签 API)
3 注意 --> 说明文档中的 API 并不全 --> 有的只在示例中, 有的是 Ant Design 中的表格属性
4 使用 ProComponents 的 ProTable 时, 为了灵活性可直接使用 Ant Design 中 Table 的标签 API
------------------------------------------------------------------------------------------
2 ProTable 组件标签 --> 常用的 API 属性
------------------------------------------------------------------------------------------
1 import ProTable from '@ant-design/pro-table'
<ProTable
headerTitle = ""
bordered
actionRef={this.actionRef}
formRef={this.formRef}
rowKey="id"
search={{}}
pagination={{}}
toolBarRender={}
columns={this.columns}
request={}
rowSelection={}
expandedRowRender={}
>
</ProTable>
------------------------------------------------------------------------------------------
5 ProCard
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------