2017-02-21 14:44:13 +08:00
|
|
|
---
|
2017-12-15 15:30:38 +08:00
|
|
|
order: 5
|
2017-02-21 14:44:13 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 其他字符
|
2017-03-06 14:23:38 +08:00
|
|
|
en-US: Other Character
|
2017-02-21 14:44:13 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
可以将星星替换为其他字符,比如字母,数字,字体图标甚至中文。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2017-03-06 14:23:38 +08:00
|
|
|
Replace the default star to other character like alphabet, digit, iconfont or even Chinese word.
|
2017-02-21 14:44:13 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2019-11-28 12:34:33 +08:00
|
|
|
import { HeartOutlined } from '@ant-design/icons';
|
2022-05-23 14:37:16 +08:00
|
|
|
import { Rate } from 'antd';
|
|
|
|
import React from 'react';
|
2017-02-21 14:44:13 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-06-11 14:11:21 +08:00
|
|
|
<>
|
2019-11-28 12:34:33 +08:00
|
|
|
<Rate character={<HeartOutlined />} allowHalf />
|
2017-02-21 14:44:13 +08:00
|
|
|
<br />
|
2017-03-06 14:23:38 +08:00
|
|
|
<Rate character="A" allowHalf style={{ fontSize: 36 }} />
|
2017-02-21 14:44:13 +08:00
|
|
|
<br />
|
2017-03-06 14:23:38 +08:00
|
|
|
<Rate character="好" allowHalf />
|
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
|
|
|
```
|