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

19 lines
400 B
Markdown
Raw Normal View History

2015-07-13 16:51:56 +08:00
# 文字和图标
- order: 2
带有文字和图标。
---
````jsx
import { Switch, Icon } from 'antd';
const container = document.getElementById('components-switch-demo-text');
2015-07-13 16:51:56 +08:00
2015-10-20 16:47:55 +08:00
ReactDOM.render(<div>
2015-07-13 16:51:56 +08:00
<Switch checkedChildren="开" unCheckedChildren="关" />
<span> </span>
2015-10-02 16:25:10 +08:00
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
2015-07-13 16:51:56 +08:00
</div>, container);
````