kn-hooks 0.0.29 → 0.0.31
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
CHANGED
|
@@ -94,7 +94,7 @@ webpack增加`bable-plugin-import`插件,给babel plugins增加配置
|
|
|
94
94
|
```js
|
|
95
95
|
const clipboard= useClipboard();
|
|
96
96
|
const onCopy=()=>{
|
|
97
|
-
clipboard
|
|
97
|
+
clipboard('text',()=>{console.log('success')})
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
<a id="module_useclipboard__funcopy"></a>
|
package/md/useClipboard.md
CHANGED
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ import ClipboardJS from 'clipboard';
|
|
|
17
17
|
* @example
|
|
18
18
|
const clipboard= useClipboard();
|
|
19
19
|
const onCopy=()=>{
|
|
20
|
-
clipboard
|
|
20
|
+
clipboard('text',()=>{console.log('success')})
|
|
21
21
|
}
|
|
22
22
|
*/
|
|
23
23
|
const useClipboard = (props) => {
|
|
@@ -45,7 +45,7 @@ return(
|
|
|
45
45
|
* @returns {UsePaginationWithFormResult}
|
|
46
46
|
*/
|
|
47
47
|
const usePaginationWithForm = (props) => {
|
|
48
|
-
const {service,pagination,...otherProps}= props;
|
|
48
|
+
const {service,pagination,beforeService=[],...otherProps}= props;
|
|
49
49
|
const [form] = useState(props.form);
|
|
50
50
|
const page = usePagination({service,pagination,...otherProps})
|
|
51
51
|
|
|
@@ -58,8 +58,14 @@ const usePaginationWithForm = (props) => {
|
|
|
58
58
|
return params;
|
|
59
59
|
};
|
|
60
60
|
page.addListener('beforeService',fnFeforeService);
|
|
61
|
+
for(let fn of beforeService){
|
|
62
|
+
page.addListener('beforeService',fn);
|
|
63
|
+
}
|
|
61
64
|
return ()=>{
|
|
62
65
|
page.removeListener('beforeService',fnFeforeService);
|
|
66
|
+
for(let fn of beforeService){
|
|
67
|
+
page.removeListener('beforeService',fn);
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
},[])
|
|
65
71
|
|