Skip to content

Commit df48c0e

Browse files
张寸起7insummer
authored andcommitted
feat:增加badge组件show属性
1 parent 76f95e7 commit df48c0e

File tree

16 files changed

+43
-18
lines changed

16 files changed

+43
-18
lines changed

dist/badge/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Component({
2323
value: 'overflow'
2424
},
2525
// 文字内容
26-
content: String
26+
content: String,
27+
show: {
28+
type: Boolean,
29+
value: true
30+
}
2731
},
2832
data: {
2933
finalCount: 0

dist/badge/index.wxml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<view class="l-badge" bindtap="handleTap">
22
<slot/>
3-
<view class="l-badge-content l-class l-class-self" wx:if="{{finalCount}}">{{finalCount}}</view>
4-
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self">{{content}}</view>
5-
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self"></view>
3+
<block wx:if="{{show}}">
4+
<view class="l-badge-content l-class l-class-self" wx:if="{{finalCount}}">{{finalCount}}</view>
5+
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self">{{content}}</view>
6+
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self"></view>
7+
</block>
68
</view>

dist/count-selector/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}
1+
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}

dist/loadmore/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<view wx:elif="{{custom && type==='loading'}}">
88
<slot name="loading" />
99
</view>
10-
<view class="loading" wx:else>
10+
<view class="loading l-class" wx:else>
1111
<view class="line"
1212
style="{{'background-color:'+color}}"
1313
wx:if="{{line}}"></view>

dist/tag/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Component({
33
properties: {
44
// 标签名称
55
name: Object,
6+
cell: String,
67
// 标签颜色
78
type:{
89
type: String,
@@ -50,6 +51,7 @@ Component({
5051
if (this.properties.disabled) return false;
5152
let options = {
5253
name: this.properties.name,
54+
cell: this.properties.cell,
5355
select: this.properties.select
5456
};
5557
this.triggerEvent('lintap', options, {

examples/components/content-title/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ page{
66
display: flex;
77
flex-direction: column;
88
align-items: center;
9-
background: #f7f7f7;
9+
background: transparent;
1010
box-sizing: border-box;
1111
padding-bottom: 160rpx;
1212
}

examples/dist/badge/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ Component({
2323
value: 'overflow'
2424
},
2525
// 文字内容
26-
content: String
26+
content: String,
27+
show: {
28+
type: Boolean,
29+
value: true
30+
}
2731
},
2832
data: {
2933
finalCount: 0

examples/dist/badge/index.wxml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<view class="l-badge" bindtap="handleTap">
22
<slot/>
3-
<view class="l-badge-content l-class l-class-self" wx:if="{{finalCount}}">{{finalCount}}</view>
4-
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self">{{content}}</view>
5-
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self"></view>
3+
<block wx:if="{{show}}">
4+
<view class="l-badge-content l-class l-class-self" wx:if="{{finalCount}}">{{finalCount}}</view>
5+
<view wx:if="{{content}}" class="l-badge-content l-class l-class-self">{{content}}</view>
6+
<view wx:if="{{dot}}" class="l-badge-dot l-class l-class-self"></view>
7+
</block>
68
</view>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}
1+
.container-count{display:flex;flex-direction:row}.symbol{height:56rpx;width:56rpx;display:inline-block;vertical-align:middle;text-align:center;line-height:56rpx;font-size:42rpx}.disabled{background-color:#f3f3f3;color:#c4c9d2}.abled{background-color:#ecf1f8;color:#596c8e}.count{height:56rpx;width:64rpx;min-height:56rpx;line-height:56rpx;font-size:24rpx;color:#596c8e;background:#f6f7f9;margin:0 4rpx;text-align:center}

examples/dist/loadmore/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<view wx:elif="{{custom && type==='loading'}}">
88
<slot name="loading" />
99
</view>
10-
<view class="loading" wx:else>
10+
<view class="loading l-class" wx:else>
1111
<view class="line"
1212
style="{{'background-color:'+color}}"
1313
wx:if="{{line}}"></view>

0 commit comments

Comments
 (0)