ant-design/components/rate/demo/character.md
xrkffgg f37f471373
feat: expand rate character (#24903)
* feat: expand rate character

* fix: demo

* fix: snap

* Update components/rate/index.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* fix

Co-authored-by: 偏右 <afc163@gmail.com>
2020-06-11 14:11:21 +08:00

595 B

order title
5
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.

import { Rate } from 'antd';
import { HeartOutlined } from '@ant-design/icons';

ReactDOM.render(
  <>
    <Rate character={<HeartOutlined />} allowHalf />
    <br />
    <Rate character="A" allowHalf style={{ fontSize: 36 }} />
    <br />
    <Rate character="好" allowHalf />
  </>,
  mountNode,
);