diff --git a/components/alert/demo/basic.md b/components/alert/demo/basic.md index 552cb6cc9c..5df1ddc48e 100644 --- a/components/alert/demo/basic.md +++ b/components/alert/demo/basic.md @@ -9,6 +9,10 @@ ````jsx var Alert = require('antd/lib/alert'); -React.render( +React.render( + , document.getElementById('components-alert-demo-basic')); ```` diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md index ec023b3ccc..4a4ce2e2c0 100644 --- a/components/alert/demo/closable.md +++ b/components/alert/demo/closable.md @@ -13,16 +13,19 @@ var onClose = function(e) { console.log(e, '我要被关闭啦!'); }; -React.render(
- - -
, document.getElementById('components-alert-demo-closable')); +React.render( +
+ + +
+, document.getElementById('components-alert-demo-closable')); ```` - diff --git a/components/alert/demo/close-type.md b/components/alert/demo/close-type.md index 1c80a181be..bf091aaca9 100644 --- a/components/alert/demo/close-type.md +++ b/components/alert/demo/close-type.md @@ -8,9 +8,14 @@ ````jsx var Alert = require('antd/lib/alert'); + var link = 不再提醒 React.render( - + , document.getElementById('components-alert-demo-close-type')); ```` diff --git a/components/alert/demo/description.md b/components/alert/demo/description.md index 1adc39f013..5d988f1791 100644 --- a/components/alert/demo/description.md +++ b/components/alert/demo/description.md @@ -9,20 +9,28 @@ ````jsx var Alert = require('antd/lib/alert'); -React.render(
- - - - -
, document.getElementById('components-alert-demo-description')); +React.render( +
+ + + + +
+, document.getElementById('components-alert-demo-description')); ```` diff --git a/components/alert/demo/onClose.md b/components/alert/demo/onClose.md new file mode 100644 index 0000000000..0314ad95f7 --- /dev/null +++ b/components/alert/demo/onClose.md @@ -0,0 +1,33 @@ +# 回调函数 + +- order: 5 + +警告提示被关闭时触发的回调函数,必须设置`closable="true"`。 + +--- + +````jsx +var Alert = require('antd/lib/alert'); + +var onClose = function(){ + console.log('我要被关闭啦!'); +} + +React.render( +
+ + +
, +document.getElementById('components-alert-demo-onclose')); +```` diff --git a/components/alert/demo/style.md b/components/alert/demo/style.md index 519501bc66..2a4dc1d252 100644 --- a/components/alert/demo/style.md +++ b/components/alert/demo/style.md @@ -9,11 +9,24 @@ ````jsx var Alert = require('antd/lib/alert'); -React.render(
- - - - -
, -document.getElementById('components-alert-demo-style')); +React.render( +
+ + + + +
+, document.getElementById('components-alert-demo-style')); ```` diff --git a/components/alert/index.jsx b/components/alert/index.jsx index 663789bff1..36fca8df2f 100644 --- a/components/alert/index.jsx +++ b/components/alert/index.jsx @@ -26,13 +26,15 @@ export default React.createClass({ case 'success': iconClass += 'check-circle'; break; - case 'info': + case 'warn': iconClass += 'question-circle'; break; - case 'error': - case 'warn': + case 'info': iconClass += 'info-circle'; break; + case 'error': + iconClass += 'exclamation-circle'; + break; default: iconClass += 'default'; } diff --git a/components/button/demo/loading.md b/components/button/demo/loading.md index 95d25bf33f..a818b92e8a 100644 --- a/components/button/demo/loading.md +++ b/components/button/demo/loading.md @@ -2,16 +2,51 @@ - order: 7 -点击后进入加载状态。 +加载按钮。最后一个按钮演示点击后进入加载状态。 --- -````html - - +````jsx +var App = React.createClass({ + getInitialState() { + return { + loading: false + }; + }, + enterLoading() { + this.setState({ + loading: true + }); + }, + render() { + var loadingClass = this.state.loading ? 'ant-btn-loading' : ''; + return
+ + + + +
+ +
; + } +}); + +React.render(, document.getElementById('components-button-demo-loading')); ```` + + diff --git a/style/components/button.less b/style/components/button.less index 107992650b..c51664f374 100644 --- a/style/components/button.less +++ b/style/components/button.less @@ -42,6 +42,28 @@ .btn-circle-outline; } + &-loading { + padding-right: 31px; + &:after { + font-family: anticon; + .animation(loadingCircle 1s infinite linear); + content: "\e610"; + position: absolute; + height: 12px; + line-height: 12px; + right: 13px; + top: 50%; + margin-top: -6px; + } + } + + &-sm&-loading { + padding-right: 24px; + &:after { + right: 8px; + } + } + &-menu { > .@{iconfont-css-prefix} { .iconfont-size-under-12px(10px); diff --git a/style/components/index.less b/style/components/index.less index 284e6605ba..1316d9fddf 100644 --- a/style/components/index.less +++ b/style/components/index.less @@ -12,7 +12,6 @@ @import "popover"; @import "pagination"; @import "form"; -@import "loading"; @import "progress"; @import "steps"; @import "breadcrumb"; diff --git a/style/components/loading.less b/style/components/loading.less deleted file mode 100644 index e69de29bb2..0000000000