Skip to content

Commit 4d70854

Browse files
committed
feat(CapsuleBar): 新增 hidden-title 属性
hidden-title 属性用于隐藏标题
1 parent b7fbc55 commit 4d70854

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/capsule-bar/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ Component({
6161
hasPadding: {
6262
type: Boolean,
6363
value: true
64+
},
65+
// 隐藏标题
66+
hiddenTitle: {
67+
type: Boolean,
68+
value: false
6469
}
6570
},
6671

@@ -73,8 +78,8 @@ Component({
7378
capsuleButtonInfo: null
7479
},
7580

76-
lifetimes:{
77-
ready:function () {
81+
lifetimes: {
82+
ready: function () {
7883
this.setData({
7984
capsuleButtonInfo: this.getCapsuleButtonInfo()
8085
});

src/capsule-bar/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class="title-bar"
1616
style="height: {{titleBarHeight}}rpx;background-color: {{titleBarColor}};"
1717
>
18-
<cover-view class="title l-title-class" style="color: {{titleColor}};">{{title}}</cover-view>
18+
<cover-view wx:if="{{!hiddenTitle}}" class="title l-title-class" style="color: {{titleColor}};">{{title}}</cover-view>
1919
</cover-view>
2020

2121
<!--胶囊按钮-->

0 commit comments

Comments
 (0)