diff --git a/components.js b/components.js index 6b040c175..d26384119 100644 --- a/components.js +++ b/components.js @@ -4,7 +4,7 @@ module.exports = [ 'cell', 'cell-group', 'icon', - 'info', + 'badge', 'image', 'col', 'row', diff --git a/src/action-bar-icon/index.js b/src/action-bar-icon/index.js index 7964f429d..c47dee5bf 100644 --- a/src/action-bar-icon/index.js +++ b/src/action-bar-icon/index.js @@ -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 (
{this.$slots.icon()} - +
); } @@ -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} /> ); diff --git a/src/action-bar/README.zh-CN.md b/src/action-bar/README.zh-CN.md index 6828f658f..f7cb4b26b 100644 --- a/src/action-bar/README.zh-CN.md +++ b/src/action-bar/README.zh-CN.md @@ -98,7 +98,6 @@ export default { | icon-class | 图标额外类名 | _any_ | - | | dot `2.5.5` | 是否显示图标右上角小红点 | _boolean_ | `false` | | badge `v2.5.6` | 图标右上角徽标的内容 | _number \| string_ | - | -| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | _number \| string_ | - | | url | 点击后跳转的链接地址 | _string_ | - | | to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - | | replace | 是否在跳转时替换当前页面历史 | _boolean_ | `false` | diff --git a/src/action-bar/test/__snapshots__/demo.spec.js.snap b/src/action-bar/test/__snapshots__/demo.spec.js.snap index 3b49bfc00..eb1a3881d 100644 --- a/src/action-bar/test/__snapshots__/demo.spec.js.snap +++ b/src/action-bar/test/__snapshots__/demo.spec.js.snap @@ -27,17 +27,17 @@ exports[`renders demo correctly 1`] = `
-
+
客服
-
5
+
5
购物车
-
12
+
12
店铺