mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-15 09:21:22 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
30 lines
587 B
Markdown
30 lines
587 B
Markdown
---
|
|
order: 5
|
|
title:
|
|
zh-CN: 其他字符
|
|
en-US: Other Character
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
可以将星星替换为其他字符,比如字母,数字,字体图标甚至中文。
|
|
|
|
## en-US
|
|
|
|
Replace the default star to other character like alphabet, digit, iconfont or even Chinese word.
|
|
|
|
```jsx
|
|
import { Rate } from 'antd';
|
|
import { HeartOutlined } from '@ant-design/icons';
|
|
|
|
export default () => (
|
|
<>
|
|
<Rate character={<HeartOutlined />} allowHalf />
|
|
<br />
|
|
<Rate character="A" allowHalf style={{ fontSize: 36 }} />
|
|
<br />
|
|
<Rate character="好" allowHalf />
|
|
</>
|
|
);
|
|
```
|