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.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
|
|
|
import React from 'react';
|
2017-12-15 15:30:38 +08:00
|
|
|
import { Rate } from 'antd';
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
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>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|