Skip to content

Commit 4f81e64

Browse files
committed
uni-badge 添加 size 属性
1 parent 6db73ce commit 4f81e64

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎components/uni-badge.vue‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616
text: {
1717
type: String,
1818
default: ''
19+
},
20+
size: {
21+
type: String,
22+
default: 'normal'
1923
}
2024
},
2125
computed: {
2226
setClass() {
23-
let classList = ['uni-badge-' + this.type];
27+
let classList = ['uni-badge-' + this.type, 'uni-badge-size-' + this.size];
2428
if (this.inverted === true) {
2529
classList.push('uni-badge-inverted')
2630
}
@@ -48,6 +52,14 @@
4852
border-radius: 100px;
4953
}
5054
55+
.uni-badge.uni-badge-size-small,
56+
.uni-badge-default.uni-badge-size-small {
57+
height: 10px;
58+
line-height: 10px;
59+
padding: 0px 3px;
60+
font-size: 8px !important;
61+
}
62+
5163
.uni-badge.uni-badge-inverted {
5264
padding: 0 5px 0 0;
5365
color: #929292;

0 commit comments

Comments
 (0)