kn-hooks 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/{readme.md → README.md}
RENAMED
|
@@ -496,8 +496,13 @@ usePagination的返回对象
|
|
|
496
496
|
|
|
497
497
|
<a id="module_usepaginationwithform"></a>
|
|
498
498
|
## <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">G</span> usePaginationWithForm
|
|
499
|
+
|
|
500
|
+
* [ usePaginationWithForm](#module_usepaginationwithform)
|
|
501
|
+
* [ usePaginationWithForm(props)](#module_usepaginationwithform__usepaginationwithform) ⇒ <code>UsePaginationWithFormResult</code>
|
|
502
|
+
* [ UsePaginationWithFormResult](#module_usepaginationwithform__usepaginationwithformresult) : <code>Object</code>
|
|
503
|
+
|
|
499
504
|
<a id="module_usepaginationwithform__usepaginationwithform"></a>
|
|
500
|
-
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">M</span> usePaginationWithForm(props)
|
|
505
|
+
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">M</span> usePaginationWithForm(props) ⇒ <code>UsePaginationWithFormResult</code>
|
|
501
506
|
支持Antd-Form的usePagination
|
|
502
507
|
作用是在查询接口前自动获取form表单内的字段,并作为接口查询参数进行查询
|
|
503
508
|
使用方法及参数字段参考 [usePagination](usePagination.md)
|
|
@@ -517,6 +522,12 @@ const page = usePaginationWithForm({
|
|
|
517
522
|
form:form
|
|
518
523
|
});
|
|
519
524
|
|
|
525
|
+
const onSearch=()=>{
|
|
526
|
+
page.update();
|
|
527
|
+
}
|
|
528
|
+
const onReset=()=>{
|
|
529
|
+
page.reset();
|
|
530
|
+
}
|
|
520
531
|
return(
|
|
521
532
|
<Form form={form} style={{width:'600px'}} layout="inline">
|
|
522
533
|
<Form.Item label='关键字' name='keyword' rules={[
|
|
@@ -532,6 +543,16 @@ return(
|
|
|
532
543
|
</Form>
|
|
533
544
|
)
|
|
534
545
|
```
|
|
546
|
+
<a id="module_usepaginationwithform__usepaginationwithformresult"></a>
|
|
547
|
+
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">T</span> UsePaginationWithFormResult : <code>Object</code>
|
|
548
|
+
usePaginationWithForm的返回对象
|
|
549
|
+
|
|
550
|
+
**Properties**
|
|
551
|
+
|
|
552
|
+
| Name | Type | Description |
|
|
553
|
+
| --- | --- | --- |
|
|
554
|
+
| reset | <code>function</code> | 重置方法 |
|
|
555
|
+
|
|
535
556
|
|
|
536
557
|
<a id="module_useswitch"></a>
|
|
537
558
|
## <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">G</span> useSwitch
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<a id="module_usepaginationwithform"></a>
|
|
2
2
|
## <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">G</span> usePaginationWithForm
|
|
3
|
+
|
|
4
|
+
* [ usePaginationWithForm](#module_usepaginationwithform)
|
|
5
|
+
* [ usePaginationWithForm(props)](#module_usepaginationwithform__usepaginationwithform) ⇒ <code>UsePaginationWithFormResult</code>
|
|
6
|
+
* [ UsePaginationWithFormResult](#module_usepaginationwithform__usepaginationwithformresult) : <code>Object</code>
|
|
7
|
+
|
|
3
8
|
<a id="module_usepaginationwithform__usepaginationwithform"></a>
|
|
4
|
-
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">M</span> usePaginationWithForm(props)
|
|
9
|
+
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">M</span> usePaginationWithForm(props) ⇒ <code>UsePaginationWithFormResult</code>
|
|
5
10
|
支持Antd-Form的usePagination
|
|
6
11
|
作用是在查询接口前自动获取form表单内的字段,并作为接口查询参数进行查询
|
|
7
12
|
使用方法及参数字段参考 [usePagination](usePagination.md)
|
|
@@ -21,6 +26,12 @@ const page = usePaginationWithForm({
|
|
|
21
26
|
form:form
|
|
22
27
|
});
|
|
23
28
|
|
|
29
|
+
const onSearch=()=>{
|
|
30
|
+
page.update();
|
|
31
|
+
}
|
|
32
|
+
const onReset=()=>{
|
|
33
|
+
page.reset();
|
|
34
|
+
}
|
|
24
35
|
return(
|
|
25
36
|
<Form form={form} style={{width:'600px'}} layout="inline">
|
|
26
37
|
<Form.Item label='关键字' name='keyword' rules={[
|
|
@@ -36,4 +47,14 @@ return(
|
|
|
36
47
|
</Form>
|
|
37
48
|
)
|
|
38
49
|
```
|
|
50
|
+
<a id="module_usepaginationwithform__usepaginationwithformresult"></a>
|
|
51
|
+
### <span style="display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:4px;color:rgb(71, 128, 227);background:#ede6e6;">T</span> UsePaginationWithFormResult : <code>Object</code>
|
|
52
|
+
usePaginationWithForm的返回对象
|
|
53
|
+
|
|
54
|
+
**Properties**
|
|
55
|
+
|
|
56
|
+
| Name | Type | Description |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| reset | <code>function</code> | 重置方法 |
|
|
59
|
+
|
|
39
60
|
|
package/package.json
CHANGED
|
@@ -22,6 +22,12 @@ const page = usePaginationWithForm({
|
|
|
22
22
|
form:form
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
const onSearch=()=>{
|
|
26
|
+
page.update();
|
|
27
|
+
}
|
|
28
|
+
const onReset=()=>{
|
|
29
|
+
page.reset();
|
|
30
|
+
}
|
|
25
31
|
return(
|
|
26
32
|
<Form form={form} style={{width:'600px'}} layout="inline">
|
|
27
33
|
<Form.Item label='关键字' name='keyword' rules={[
|
|
@@ -36,6 +42,7 @@ return(
|
|
|
36
42
|
<Button onClick={onReset} type='primary'>重置</Button>
|
|
37
43
|
</Form>
|
|
38
44
|
)
|
|
45
|
+
* @returns {UsePaginationWithFormResult}
|
|
39
46
|
*/
|
|
40
47
|
const usePaginationWithForm = (props) => {
|
|
41
48
|
const {service,pagination}= props;
|
|
@@ -83,4 +90,13 @@ const usePaginationWithForm = (props) => {
|
|
|
83
90
|
};
|
|
84
91
|
};
|
|
85
92
|
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* usePaginationWithForm的返回对象
|
|
96
|
+
* @typedef {Object} UsePaginationWithFormResult
|
|
97
|
+
* @property {Function} reset - 重置方法
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
86
102
|
export default usePaginationWithForm
|