mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-26 22:31:46 +08:00
Make tip replace dot
This commit is contained in:
parent
3068ec357b
commit
f7ba2969f6
@ -2,14 +2,18 @@
|
|||||||
|
|
||||||
- order: 4
|
- order: 4
|
||||||
|
|
||||||
自定义描述文案。
|
自定义描述文案,指定的 tip 文案会直接代替 `...`。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
````jsx
|
````jsx
|
||||||
import { Spin } from 'antd';
|
import { Spin, Alert } from 'antd';
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Spin tip="自定义描述文案"/>
|
<Spin tip="正在读取数据...">
|
||||||
|
<Alert message="消息提示的文案"
|
||||||
|
description="消息提示的辅助性文字介绍消息提示的辅助性文字介绍消息提示的辅助性文字介绍"
|
||||||
|
type="info" />
|
||||||
|
</Spin>
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -6,13 +6,13 @@ const AntSpin = React.createClass({
|
|||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
prefixCls: 'ant-spin',
|
prefixCls: 'ant-spin',
|
||||||
spining: true
|
spining: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
className: React.PropTypes.string,
|
className: React.PropTypes.string,
|
||||||
size: React.PropTypes.oneOf(['small', 'default', 'large'])
|
size: React.PropTypes.oneOf(['small', 'default', 'large']),
|
||||||
},
|
},
|
||||||
|
|
||||||
isNestedPattern() {
|
isNestedPattern() {
|
||||||
@ -31,13 +31,12 @@ const AntSpin = React.createClass({
|
|||||||
});
|
});
|
||||||
|
|
||||||
let spinElement;
|
let spinElement;
|
||||||
if (!isCssAnimationSupported) {
|
if (!isCssAnimationSupported || 'tip' in this.props) {
|
||||||
// not support for animation, just use text instead
|
// not support for animation, just use text instead
|
||||||
spinElement = <div className={spinClassName}>{tip || '加载中...'}</div>;
|
spinElement = <div className={spinClassName}>{tip || '加载中...'}</div>;
|
||||||
} else {
|
} else {
|
||||||
spinElement = (
|
spinElement = (
|
||||||
<div className={spinClassName}>
|
<div className={spinClassName}>
|
||||||
<div className={`${prefixCls}-tip`}>{tip}</div>
|
|
||||||
<div className={`${prefixCls}-dots`}>
|
<div className={`${prefixCls}-dots`}>
|
||||||
<span className={`${prefixCls}-dot ${prefixCls}-dot-first`} />
|
<span className={`${prefixCls}-dot ${prefixCls}-dot-first`} />
|
||||||
<span className={`${prefixCls}-dot ${prefixCls}-dot-second`} />
|
<span className={`${prefixCls}-dot ${prefixCls}-dot-second`} />
|
||||||
|
Loading…
Reference in New Issue
Block a user