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.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2019-08-13 14:07:17 +08:00
|
|
|
import { Switch } from 'antd';
|
2019-11-28 12:34:33 +08:00
|
|
|
import { CloseOutlined, CheckOutlined } from '@ant-design/icons';
|
2015-07-13 16:51:56 +08:00
|
|
|
|
2017-10-09 13:23:20 +08:00
|
|
|
ReactDOM.render(
|
2020-07-07 23:04:27 +08:00
|
|
|
<>
|
2020-05-18 13:00:33 +08:00
|
|
|
<Switch checkedChildren="开启" unCheckedChildren="关闭" defaultChecked />
|
2017-10-09 13:23:20 +08:00
|
|
|
<br />
|
|
|
|
<Switch checkedChildren="1" unCheckedChildren="0" />
|
|
|
|
<br />
|
2019-11-28 12:34:33 +08:00
|
|
|
<Switch
|
|
|
|
checkedChildren={<CheckOutlined />}
|
|
|
|
unCheckedChildren={<CloseOutlined />}
|
|
|
|
defaultChecked
|
|
|
|
/>
|
2020-07-07 23:04:27 +08:00
|
|
|
</>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|