2017-12-15 15:30:38 +08:00
|
|
|
---
|
|
|
|
order: 4
|
|
|
|
title:
|
|
|
|
zh-CN: 清除
|
|
|
|
en-US: Clear star
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
支持允许或者禁用清除。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Support set allow to clear star when click again.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2017-12-15 15:30:38 +08:00
|
|
|
import { Rate } from 'antd';
|
|
|
|
|
|
|
|
ReactDOM.render(
|
2020-06-11 14:11:21 +08:00
|
|
|
<>
|
2019-07-21 13:01:27 +08:00
|
|
|
<Rate defaultValue={3} />
|
|
|
|
<span className="ant-rate-text">allowClear: true</span>
|
2017-12-15 15:30:38 +08:00
|
|
|
<br />
|
2019-07-21 13:01:27 +08:00
|
|
|
<Rate allowClear={false} defaultValue={3} />
|
|
|
|
<span className="ant-rate-text">allowClear: false</span>
|
2020-06-11 14:11:21 +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
|
|
|
```
|