ant-design/components/rate/demo/character.md

30 lines
560 B
Markdown
Raw Normal View History

---
order: 5
title:
zh-CN: 其他字符
2017-03-06 14:23:38 +08:00
en-US: Other Character
---
## 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.
2019-05-07 14:57:32 +08:00
```jsx
import { Rate, Icon } from 'antd';
ReactDOM.render(
<div>
2017-03-06 14:23:38 +08:00
<Rate character={<Icon type="heart" />} allowHalf />
<br />
2017-03-06 14:23:38 +08:00
<Rate character="A" allowHalf style={{ fontSize: 36 }} />
<br />
2017-03-06 14:23:38 +08:00
<Rate character="好" allowHalf />
2018-06-27 15:55:04 +08:00
</div>,
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
```