mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
bec5a08368
* add input-number demo * update snapshot * update demo * docs: Update desc * update doc * clean up React useLayoutEffect warning * fix ts definition * re-trigger * update rc-uitl version * bump rc-input-number * update * update * fix ts * update demo snapshot * update doc * update demo
38 lines
643 B
Markdown
38 lines
643 B
Markdown
---
|
|
order: 5
|
|
title:
|
|
zh-CN: 键盘行为
|
|
en-US: Keyboard
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
使用 `keyboard` 属性可以控制键盘行为。
|
|
|
|
## en-US
|
|
|
|
Control keyboard behavior by `keyboard`.
|
|
|
|
```tsx
|
|
import { InputNumber, Checkbox, Space } from 'antd';
|
|
|
|
const App = () => {
|
|
const [keyboard, setKeyboard] = React.useState(true);
|
|
return (
|
|
<Space>
|
|
<InputNumber min={1} max={10} keyboard={keyboard} defaultValue={3} />
|
|
<Checkbox
|
|
onChange={() => {
|
|
setKeyboard(!keyboard);
|
|
}}
|
|
checked={keyboard}
|
|
>
|
|
Toggle keyboard
|
|
</Checkbox>
|
|
</Space>
|
|
);
|
|
};
|
|
|
|
ReactDOM.render(<App />, mountNode);
|
|
```
|