2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 2
|
2016-07-26 09:17:46 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 文字和图标
|
|
|
|
en-US: Text & icon
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-07-13 16:51:56 +08:00
|
|
|
|
2016-07-26 09:17:46 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-07-13 16:51:56 +08:00
|
|
|
带有文字和图标。
|
|
|
|
|
2016-07-26 09:17:46 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
With text and icon.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Switch, Icon } from 'antd';
|
2015-07-13 16:51:56 +08:00
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(<div>
|
2016-09-29 14:35:33 +08:00
|
|
|
<Switch checkedChildren={'开'} unCheckedChildren={'关'} />
|
2016-10-21 11:09:24 +08:00
|
|
|
<br />
|
2016-09-29 14:35:33 +08:00
|
|
|
<Switch checkedChildren="1" unCheckedChildren="0" />
|
2016-10-21 11:09:24 +08:00
|
|
|
<br />
|
2015-10-02 16:25:10 +08:00
|
|
|
<Switch checkedChildren={<Icon type="check" />} unCheckedChildren={<Icon type="cross" />} />
|
2015-12-29 12:08:58 +08:00
|
|
|
</div>, mountNode);
|
2015-07-13 16:51:56 +08:00
|
|
|
````
|