mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 20:49:14 +08:00
🎨 refactor some code
This commit is contained in:
parent
fbcc884b5b
commit
ace93f1b42
@ -61,13 +61,17 @@ export default class Progress extends React.Component<ProgressProps> {
|
|||||||
default: PropTypes.oneOf(['default', 'small']),
|
default: PropTypes.oneOf(['default', 'small']),
|
||||||
};
|
};
|
||||||
|
|
||||||
getProgressStatus() {
|
getPercentNumber() {
|
||||||
const { successPercent, percent = 0, status } = this.props;
|
const { successPercent, percent = 0 } = this.props;
|
||||||
const percentNumber = parseInt(
|
return parseInt(
|
||||||
successPercent !== undefined ? successPercent.toString() : percent.toString(),
|
successPercent !== undefined ? successPercent.toString() : percent.toString(),
|
||||||
10,
|
10,
|
||||||
);
|
);
|
||||||
if (percentNumber >= 100 && ProgressStatuses.indexOf(status!) < 0) {
|
}
|
||||||
|
|
||||||
|
getProgressStatus() {
|
||||||
|
const { status } = this.props;
|
||||||
|
if (ProgressStatuses.indexOf(status!) < 0 && this.getPercentNumber() >= 100) {
|
||||||
return 'success';
|
return 'success';
|
||||||
}
|
}
|
||||||
return status || 'normal';
|
return status || 'normal';
|
||||||
|
Loading…
Reference in New Issue
Block a user