mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
626 B
626 B
order | title | ||||
---|---|---|---|---|---|
5 |
|
zh-CN
使用 keyboard
属性可以控制键盘行为。
en-US
Control keyboard behavior by keyboard
.
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>
);
};
export default App;