feat(TabbarItem): add badge prop, mark info prop as deprecated

This commit is contained in:
chenjiahan
2020-03-17 20:49:08 +08:00
parent 575577ed58
commit d61cbdd086
4 changed files with 20 additions and 15 deletions
+5 -1
View File
@@ -20,6 +20,7 @@ export default createComponent({
icon: String,
name: [Number, String],
info: [Number, String],
badge: [Number, String],
iconPrefix: String,
},
@@ -70,7 +71,10 @@ export default createComponent({
<div class={bem({ active })} style={{ color }} onClick={this.onClick}>
<div class={bem('icon')}>
{this.genIcon(active)}
<Info dot={this.dot} info={this.info} />
<Info
dot={this.dot}
info={isDef(this.badge) ? this.badge : this.info}
/>
</div>
<div class={bem('text')}>{this.slots('default', { active })}</div>
</div>