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