mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
charactor => character
This commit is contained in:
parent
1e46687074
commit
df7dc8511c
@ -69,7 +69,7 @@ exports[`test renders ./components/rate/demo/basic.md correctly 1`] = `
|
||||
</ul>
|
||||
`;
|
||||
|
||||
exports[`test renders ./components/rate/demo/charactor.md correctly 1`] = `
|
||||
exports[`test renders ./components/rate/demo/character.md correctly 1`] = `
|
||||
<div>
|
||||
<ul
|
||||
class="ant-rate">
|
||||
|
@ -2,7 +2,7 @@
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 其他字符
|
||||
en-US: Other Charactor
|
||||
en-US: Other Character
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@ -11,18 +11,18 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Replace the default star to other charactor like alphabet, digit, iconfont or even Chinese word.
|
||||
Replace the default star to other character like alphabet, digit, iconfont or even Chinese word.
|
||||
|
||||
````jsx
|
||||
import { Rate, Icon } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Rate charactor={<Icon type="heart" />} allowHalf />
|
||||
<Rate character={<Icon type="heart" />} allowHalf />
|
||||
<br />
|
||||
<Rate charactor="A" allowHalf style={{ fontSize: 36 }} />
|
||||
<Rate character="A" allowHalf style={{ fontSize: 36 }} />
|
||||
<br />
|
||||
<Rate charactor="好" allowHalf />
|
||||
<Rate character="好" allowHalf />
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -22,6 +22,6 @@ Rate component.
|
||||
| onHoverChange | callback when hover item | Function(value: number) | - |
|
||||
| allowHalf | whether to allow semi selection | boolean | false |
|
||||
| disabled | read only, unable to interact | boolean | false |
|
||||
| charactor | custom charactor of rate | ReactNode | `<Icon type="star" />` |
|
||||
| character | custom character of rate | ReactNode | `<Icon type="star" />` |
|
||||
| className | custom class name of rate | string | - |
|
||||
| style | custom style object of rate | object | - |
|
||||
|
@ -12,7 +12,7 @@ export interface RateProps {
|
||||
disabled?: boolean;
|
||||
onChange?: (value: number) => any;
|
||||
onHoverChange?: (value: number) => any;
|
||||
charactor?: React.ReactNode;
|
||||
character?: React.ReactNode;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
@ -20,11 +20,11 @@ export interface RateProps {
|
||||
export default class Rate extends React.Component<RateProps, any> {
|
||||
static propTypes = {
|
||||
prefixCls: PropTypes.string,
|
||||
charactor: PropTypes.node,
|
||||
character: PropTypes.node,
|
||||
};
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-rate',
|
||||
charactor: <Icon type="star" />,
|
||||
character: <Icon type="star" />,
|
||||
};
|
||||
render() {
|
||||
return <RcRate {...this.props} />;
|
||||
|
@ -23,6 +23,6 @@ title: Rate
|
||||
| onHoverChange | 鼠标经过时数值变化的回调 | Function(value: number) | - |
|
||||
| allowHalf | 是否允许半选 | boolean | false |
|
||||
| disabled | 只读,无法进行交互 | boolean | false |
|
||||
| charactor | 自定义字符 | ReactNode | `<Icon type="star" />` |
|
||||
| character | 自定义字符 | ReactNode | `<Icon type="star" />` |
|
||||
| className | 自定义样式类名 | string | - |
|
||||
| style | 自定义样式对象 | object | - |
|
||||
|
@ -56,7 +56,7 @@
|
||||
"rc-pagination": "~1.7.0",
|
||||
"rc-progress": "~2.0.1",
|
||||
"rc-radio": "~2.0.0",
|
||||
"rc-rate": "~2.0.1",
|
||||
"rc-rate": "~2.1.0",
|
||||
"rc-select": "~6.7.1",
|
||||
"rc-slider": "~6.1.0",
|
||||
"rc-steps": "~2.4.0",
|
||||
|
Loading…
Reference in New Issue
Block a user