mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
Merge branch 'develop-0.10.0' of github.com:ant-design/ant-design into develop-0.10.0
This commit is contained in:
commit
b4830a8dd1
@ -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'));
|
||||
|
@ -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'));
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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 |
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user