File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ export default {
45
45
$slots,
46
46
numberStyle,
47
47
} = this
48
- const isDot = dot || status
49
48
let displayCount = count > overflowCount ? `${ overflowCount } +` : count
49
+ const isZero = displayCount === '0' || displayCount === 0
50
+ const isDot = ( dot && ! isZero ) || status
50
51
// dot mode don't need count
51
52
if ( isDot ) {
52
53
displayCount = ''
53
54
}
54
55
const children = filterEmpty ( $slots . default )
55
- const isZero = displayCount === '0' || displayCount === 0
56
56
const isEmpty = displayCount === null || displayCount === undefined || displayCount === ''
57
57
const hidden = ( isEmpty || ( isZero && ! showZero ) ) && ! isDot
58
58
const statusCls = classNames ( {
@@ -62,7 +62,7 @@ export default {
62
62
const scrollNumberCls = classNames ( {
63
63
[ `${ prefixCls } -dot` ] : isDot ,
64
64
[ `${ prefixCls } -count` ] : ! isDot ,
65
- [ `${ prefixCls } -multiple-words` ] : count && count . toString && count . toString ( ) . length > 1 ,
65
+ [ `${ prefixCls } -multiple-words` ] : ! isDot && count && count . toString && count . toString ( ) . length > 1 ,
66
66
[ `${ prefixCls } -status-${ status } ` ] : ! ! status ,
67
67
} )
68
68
const badgeCls = classNames ( prefixCls , {
Original file line number Diff line number Diff line change 6
6
<us >
7
7
#### Red badge
8
8
This will simply display a red badge, without a specific count.
9
+ If count equals 0, it won't display the dot.
9
10
</us >
10
11
11
12
``` html
@@ -14,6 +15,9 @@ This will simply display a red badge, without a specific count.
14
15
<a-badge dot >
15
16
<a-icon type =" notification" />
16
17
</a-badge >
18
+ <a-badge :count =" 0" dot >
19
+ <a-icon type =" notification" />
20
+ </a-badge >
17
21
<a-badge dot >
18
22
<a href =" #" >Link something</a >
19
23
</a-badge >
Original file line number Diff line number Diff line change 113
113
top : auto ;
114
114
display : block ;
115
115
position : relative ;
116
- transform : none !important ;
116
+ }
117
+ &-not-a-wrapper .@{badge-prefix-cls} -count {
118
+ transform : none ;
117
119
}
118
120
}
119
121
You can’t perform that action at this time.
0 commit comments