mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
support other props like style in Spin
This commit is contained in:
parent
91a8712bfa
commit
800b6801e8
@ -62,20 +62,20 @@ export default class Spin extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className, size, prefixCls, tip } = this.props;
|
||||
const { className, size, prefixCls, tip, ...restProps } = this.props;
|
||||
const { spinning } = this.state;
|
||||
|
||||
const spinClassName = classNames({
|
||||
[prefixCls]: true,
|
||||
[`${prefixCls}-sm`]: size === 'small',
|
||||
[`${prefixCls}-lg`]: size === 'large',
|
||||
[className]: !!className,
|
||||
[`${prefixCls}-spinning`]: spinning,
|
||||
[`${prefixCls}-show-text`]: !!this.props.tip,
|
||||
[className]: !!className,
|
||||
});
|
||||
|
||||
const spinElement = (
|
||||
<div className={spinClassName}>
|
||||
<div {...restProps} className={spinClassName}>
|
||||
<span className={`${prefixCls}-dot ${prefixCls}-dot-first`} />
|
||||
<span className={`${prefixCls}-dot ${prefixCls}-dot-second`} />
|
||||
<span className={`${prefixCls}-dot ${prefixCls}-dot-third`} />
|
||||
@ -85,7 +85,7 @@ export default class Spin extends React.Component {
|
||||
|
||||
if (this.isNestedPattern()) {
|
||||
return (
|
||||
<div className={spinning ? (`${prefixCls}-nested-loading`) : ''}>
|
||||
<div {...restProps} className={spinning ? (`${prefixCls}-nested-loading`) : ''}>
|
||||
{spinElement}
|
||||
<div className={`${prefixCls}-container`}>
|
||||
{this.props.children}
|
||||
|
Loading…
Reference in New Issue
Block a user