ant-design/components/switch/demo/basic.md

19 lines
323 B
Markdown
Raw Normal View History

2015-07-13 16:51:56 +08:00
# 简单
2015-07-08 19:47:45 +08:00
- order: 0
2015-07-13 16:51:56 +08:00
最简单的用法。
2015-07-08 19:47:45 +08:00
---
````jsx
import { Switch } from 'antd';
const container = document.getElementById('components-switch-demo-basic');
2015-07-08 19:47:45 +08:00
function onChange(checked){
console.log('switch to ' + checked);
}
2015-10-20 16:47:55 +08:00
ReactDOM.render(<Switch defaultChecked={false} onChange={onChange} />, container);
2015-07-08 19:47:45 +08:00
````