Skip to content

Commit

Permalink
feat: support i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys026 committed Jan 12, 2020
1 parent f166d69 commit 3f1615c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .umirc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ export default {
style: true,
},
]],
doc: {
locales: [['en-US', 'English'], ['zh-CN', '中文']]
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"docz-theme-umi-hooks": "^0.0.7",
"enzyme": "^3.10.0",
"father": "^2.13.3",
"father-doc": "^1.0.0-alpha.4",
"father-doc": "^1.0.0-alpha.13",
"jackbox": "^0.2.0",
"now": "^16.2.0",
"raw-loader": "^3.1.0",
Expand Down
File renamed without changes.
44 changes: 44 additions & 0 deletions src/useBoolean/index.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: useBoolean
group:
title: State Hooks
path: /state
---

# useBoolean

A hook that elegantly manages boolean values.

## Examples

### Default usage

<code src="./demo/demo1.tsx" />

## API

```javascript
const {
state,
toggle,
setTrue,
setFalse
} = useBoolean(
defaultValue?: boolean,
);
```

### Result

| Property | Description | Type |
|----------|--------------------------------------|----------------------|
| state | State value | boolean |
| toggle | Trigger state change, accept an optional parameter | (value?: any) => void |
| setTrue | Set state value true | () => void |
| setFalse | Set state value false | () => void |

### Params

| Property | Description | Type | Default |
|---------|----------------------------------------------|------------------------|--------|
| defaultValue | Optional,set a default value | boolean \| undefined | false |

0 comments on commit 3f1615c

Please sign in to comment.