Skip to content

Commit

Permalink
Replace property spining with spinning
Browse files Browse the repository at this point in the history
  • Loading branch information
wizawu committed Apr 14, 2016
1 parent 4835471 commit 577663d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/spin/demo/nested.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Card = React.createClass({
);
return (
<div>
<Spin spining={this.state.loading}>{container}</Spin>
<Spin spinning={this.state.loading}>{container}</Spin>
切换加载状态:<Switch checked={this.state.loading} onChange={this.toggle} />
</div>
);
Expand Down
7 changes: 5 additions & 2 deletions components/spin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { isCssAnimationSupported } from 'css-animation';
export default class Spin extends React.Component {
static defaultProps = {
prefixCls: 'ant-spin',
spinning: true,
// Backwards support
spining: true,
}

Expand All @@ -27,13 +29,14 @@ export default class Spin extends React.Component {

render() {
const { className, size, prefixCls, tip } = this.props;
const spinning = this.props.spinning && this.props.spining;

let spinClassName = classNames({
[prefixCls]: true,
[`${prefixCls}-sm`]: size === 'small',
[`${prefixCls}-lg`]: size === 'large',
[className]: !!className,
[`${prefixCls}-spining`]: this.props.spining,
[`${prefixCls}-spinning`]: spinning,
[`${prefixCls}-show-text`]: !!this.props.tip,
});

Expand All @@ -48,7 +51,7 @@ export default class Spin extends React.Component {

if (this.isNestedPattern()) {
return (
<div className={this.props.spining ? (`${prefixCls}-nested-loading`) : ''}>
<div className={spinning ? (`${prefixCls}-nested-loading`) : ''}>
{spinElement}
<div className={`${prefixCls}-container`}>
{this.props.children}
Expand Down
2 changes: 1 addition & 1 deletion components/spin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ english: Spin
| 参数 | 类型 | 默认值 | 说明 |
|------------|----------------|-------------|--------------|
| size | enum | default | spin组件中点的大小,可选值为 small default large |
| spining | boolean | true | 用于内嵌其他组件的模式,可以关闭 loading 效果 |
| spinning | boolean | true | 用于内嵌其他组件的模式,可以关闭 loading 效果 |
| tip | string || 自定义描述文案 |
2 changes: 1 addition & 1 deletion style/components/spin.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
transition: opacity 0.3s @ease-in-out-circ;
font-size: @font-size-base;

&-spining {
&-spinning {
opacity: 1;
position: static;
visibility: visible;
Expand Down

0 comments on commit 577663d

Please sign in to comment.