Made with create-react-library
npm install lian-hooksObject*functionObjectObjectArray**functionsetTimeout的hooks实现
***BooleanBooleanObject真假值状态封装
Object弹出框状态封装
| Param | Type | Description |
| --- | --- | --- |
| target | \* | dom对象或其ref引用 |
| eventName | \* | 事件名称 |
| listener | \* | 事件监听器 |
ObjectObject - {width, height} | Param | Description |
| --- | --- |
| ref | 元素ref引用 |
\*\* - 鼠标位置信息 functionfunction - 一个获取拖拽属性的函数,入参为拖拽传输的数据 | Param | Type | Description |
| --- | --- | --- |
| config | Object | 拖拽开始执行的函数, 拖拽结束执行的函数 |
ObjectObject - 释放元素属性 ObjectObject - 包含宽度和拖拽状态的对象 | Param | Type | Description |
| --- | --- | --- |
| options | Object | |
| options.defaultWidth | Number | 默认宽度 |
| options.minWidth | Number | 最小宽度 |
| options.maxWidth | Number | 最大宽度 |
| options.target | \* | 被拉伸的容器 |
| options.siderTarget | \* | 用于拉伸的边缘 |
ArrayArray - 异步方法和状态信息 | Param | Type | Description |
| --- | --- | --- |
| method | function | 异步方法 |
| [initialData] | Object | 初始数据 |
| Param | Type | Description |
| --- | --- | --- |
| options | Object | 配置 |
| options.method | function | 请求方法 |
| [options.defaultParams] | Object | 默认参数 |
| [options.necessaryParams] | Object | 必要参数 |
| [options.ready] | Boolean | === true时发起请求,默认值为true |
| [options.initialData] | \* | 初始数据 |
| [options.rest] | Array | 请求方法额外参数, onError事件等options可以通过这个参数传递 |
\*\* - pagination | Param | Type | Description |
| --- | --- | --- |
| config | Object | |
| config.defaultPageSize | \* | 默认分页大小 |
| config.total | \* | 总数据条数 |
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| options | Object | | 配置信息 |
| options.method | function | | 请求方法 |
| [options.defaultPageSize] | Number | 10 | 默认分页大小 |
| [options.necessaryParams] | Object | | 必要请求参数 |
| [options.rowSelection] | Object \| Boolean | | 选择功能配置, 传true使用默认 |
| [options.formatter] | function | | 请求结果数据转换函数, 返回{total, dataSource} |
\*\* - clearInterval | Param | Type | Description |
| --- | --- | --- |
| func | function | 要执行的函数 |
| interval | Number | 执行间隔 |
| deps | Array | 依赖项 |
functionKind: global constant
Returns: function - clearTimeout
| Param | Type | Description |
| --- | --- | --- |
| func | function | 要执行的函数 |
| timeout | Number | 执行间隔 |
| deps | Array | 依赖项 |
\*\* - 放缓变化的值 | Param | Type | Description |
| --- | --- | --- |
| value | \* | 要节流的值 |
| wait | Number | 节流时间间隔 |
\*\* - 处理后的值 | Param | Type | Description |
| --- | --- | --- |
| value | \* | 要节流的值 |
| wait | Number | 节流时间间隔 |
| Param | Type | Description |
| --- | --- | --- |
| effect | EffectCallback | 作用 |
| deps | Array | 依赖 |
| shouldUpdate | function | 是否执行作用,返回true执行effect |
| Param | Type | Description |
| --- | --- | --- |
| effect | EffectCallback | 作用 |
| deps | Array | 依赖 |
| compare | function | 自定义比较函数 |
| Param | Type | Description |
| --- | --- | --- |
| effect | EffectCallback | 作用 |
| deps | Array | 依赖 |
\*\* - 前一个值 | Param | Type | Description |
| --- | --- | --- |
| state | \* | 当前值 |
| [compare] | function | 比较函数, 返回true时更新上一个值,默认每次渲染都更新 |
| Param | Type | Description |
| --- | --- | --- |
| fn | function | 要执行的函数 |
| deps | Array | 依赖项 |
| Param | Type | Description |
| --- | --- | --- |
| fn | function | 操作函数 |
BooleanBoolean - : 组件是否已卸载 BooleanBoolean - : 组件是否已挂载 | Param | Type | Description |
| --- | --- | --- |
| args | array | 打印内容 |
ObjectKind: global constant
| Param | Type | Description |
| --- | --- | --- |
| initialFlag | \* | 初始状态 |
ObjectKind: global constant
| Param | Type | Description |
| --- | --- | --- |
| [initialProps] | Object | modal属性初始值 |