breaking change: rename Info to Badge
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user