mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
improve code style
This commit is contained in:
parent
74975a801a
commit
e7e1f52648
@ -33,15 +33,16 @@ export default class Spin extends React.Component {
|
|||||||
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`;
|
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpinning(props) {
|
getSpinning(props) {
|
||||||
warning(!('spining' in this.props), '`spining` property of Spin is a spell mistake, use `spinning` instead.');
|
|
||||||
const { spinning, spining } = props;
|
|
||||||
// Backwards support
|
// Backwards support
|
||||||
if (spining !== undefined) {
|
if ('spining' in props) {
|
||||||
return spining;
|
warning(false, '`spining` property of Spin is a spell mistake, use `spinning` instead.');
|
||||||
|
return props.spining;
|
||||||
}
|
}
|
||||||
return spinning;
|
return props.spinning;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const spinning = this.getSpinning(nextProps);
|
const spinning = this.getSpinning(nextProps);
|
||||||
if (this.debounceTimeout) {
|
if (this.debounceTimeout) {
|
||||||
@ -53,6 +54,7 @@ export default class Spin extends React.Component {
|
|||||||
this.setState({ spinning });
|
this.setState({ spinning });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { className, size, prefixCls, tip } = this.props;
|
const { className, size, prefixCls, tip } = this.props;
|
||||||
const { spinning } = this.state;
|
const { spinning } = this.state;
|
||||||
|
Loading…
Reference in New Issue
Block a user