Merge branch 'develop-0.10.0' of github.com:ant-design/ant-design into develop-0.10.0

This commit is contained in:
yiminghe 2015-11-04 18:08:29 +08:00
commit b4830a8dd1
6 changed files with 12 additions and 16 deletions

View File

@ -10,10 +10,10 @@
import { Badge } from 'antd';
ReactDOM.render(<div>
<Badge count="99">
<Badge count={99}>
<a href="#" className="head-example"></a>
</Badge>
<Badge count="200">
<Badge count={200}>
<a href="#" className="head-example"></a>
</Badge>
</div>, document.getElementById('components-badge-demo-99plus'));

View File

@ -10,7 +10,7 @@
import { Badge } from 'antd';
ReactDOM.render(
<Badge count="5">
<Badge count={5}>
<a href="#" className="head-example"></a>
</Badge>
, document.getElementById('components-badge-demo-basic'));

View File

@ -11,7 +11,7 @@ import { Badge } from 'antd';
ReactDOM.render(
<a href="#">
<Badge count="5">
<Badge count={5}>
<span className="head-example"></span>
</Badge>
</a>

View File

@ -14,7 +14,8 @@ class AntBadge extends React.Component {
</span>;
}
let count = this.props.count;
if (!count) {
// null undefined "" "0" 0
if (!count || count === '0') {
return cloneElement(this.props.children);
} else {
count = count >= 100 ? '99+' : count;

View File

@ -15,12 +15,12 @@
## API
```jsx
<Badge count="5">
<Badge count={5}>
<a href="#" className="head-example"></a>
</Badge>
```
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|----------------|----------------------------------|------------|---------|--------|
| count | 展示的数字,大于 99 时显示为 99+ | Number | | |
| count | 展示的数字,大于 99 时显示为 99+,为 0 时隐藏 | Number | | |
| dot | 不展示数字,只有一个小红点 | boolean | | false |

View File

@ -38,7 +38,7 @@
content: "\e60f";
vertical-align: middle;
transition: transform 0.24s ease;
top: -1px;
top: 0;
left: 16px;
top: ~"16px \9";
left: ~"0 \9";
@ -77,14 +77,9 @@
}
}
& > &-item-active {
> .@{collapse-prefix-cls}-header {
.arrow {
top: -1px;
left: 16px;
#arrow > .open();
}
& > &-item > &-header[aria-expanded="true"] {
.arrow {
#arrow > .open();
}
}
}