breaking change: rename Info to Badge

This commit is contained in:
chenjiahan
2020-08-20 19:36:12 +08:00
parent 4e5f509b2f
commit 63bd4700ab
40 changed files with 157 additions and 178 deletions
+4 -7
View File
@@ -1,8 +1,8 @@
import { createNamespace, isDef } from '../utils';
import { createNamespace } from '../utils';
import { route, routeProps } from '../utils/router';
import { ChildrenMixin } from '../mixins/relation';
import Info from '../info';
import Icon from '../icon';
import Badge from '../badge';
const [createComponent, bem] = createNamespace('action-bar-icon');
@@ -15,7 +15,6 @@ export default createComponent({
text: String,
icon: String,
color: String,
info: [Number, String],
badge: [Number, String],
iconClass: null,
},
@@ -29,13 +28,11 @@ export default createComponent({
},
genIcon() {
const info = isDef(this.badge) ? this.badge : this.info;
if (this.$slots.icon) {
return (
<div class={bem('icon')}>
{this.$slots.icon()}
<Info dot={this.dot} info={info} />
<Badge dot={this.dot} badge={this.badge} />
</div>
);
}
@@ -45,8 +42,8 @@ export default createComponent({
class={[bem('icon'), this.iconClass]}
tag="div"
dot={this.dot}
info={info}
name={this.icon}
badge={this.badge}
color={this.color}
/>
);