kn-hooks 0.0.14 → 0.0.15
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/package.json
CHANGED
|
@@ -186,6 +186,10 @@ const useDictionary=(props)=>{
|
|
|
186
186
|
* @param {ReactDom} params.SelectOption - Antd的SelectOption组件
|
|
187
187
|
* @param {ReactDom} params.RadioOption - Antd的SelectOption组件
|
|
188
188
|
* @returns {void}
|
|
189
|
+
* @example
|
|
190
|
+
import {useDictionary} from 'kn-hooks';
|
|
191
|
+
import {Select,Radio} from 'antd';
|
|
192
|
+
useDictionary.SetConfig(Select.Option,Radio.Option);
|
|
189
193
|
*/
|
|
190
194
|
export const SetConfig = ({SelectOption,RadioOption})=>{
|
|
191
195
|
if(SelectOption)DEFAULT_CONFIG.SelectOption = SelectOption;
|
|
@@ -210,7 +214,8 @@ export const SetConfig = ({SelectOption,RadioOption})=>{
|
|
|
210
214
|
*
|
|
211
215
|
* @example
|
|
212
216
|
// emUserType.jsx
|
|
213
|
-
|
|
217
|
+
import {useDictionary} from 'kn-hooks';
|
|
218
|
+
export const userType = useDictionary.createDictionary({
|
|
214
219
|
api:()=>Promise.resolve([{id:'1001',label:'项目1001',name:'pm1001'},]),
|
|
215
220
|
afterApi:(response)=>{
|
|
216
221
|
return response?.data;
|
|
@@ -371,6 +376,7 @@ export const createDictionary=options=>{
|
|
|
371
376
|
*/
|
|
372
377
|
|
|
373
378
|
|
|
374
|
-
|
|
379
|
+
useDictionary.createDictionary=createDictionary;
|
|
380
|
+
useDictionary.SetConfig = SetConfig;
|
|
375
381
|
|
|
376
382
|
export default useDictionary
|