- {props.info}
+
+ {dot ? '' : props.info}
);
}
Info.props = {
+ dot: Boolean,
info: [Number, String]
};
diff --git a/src/style/var.less b/src/style/var.less
index d737c3c94..484534ec2 100644
--- a/src/style/var.less
+++ b/src/style/var.less
@@ -318,6 +318,8 @@
@info-font-weight: 500;
@info-border-width: 1px;
@info-background-color: @red;
+@info-dot-color: @red;
+@info-dot-size: 8px;
@info-font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
// Image
diff --git a/src/tabbar/README.md b/src/tabbar/README.md
index 7708c881e..47eb7f284 100644
--- a/src/tabbar/README.md
+++ b/src/tabbar/README.md
@@ -163,7 +163,7 @@ export default {
| name | Identifier | *string \| number* | Item index | - |
| icon | Icon name | *string* | - | - |
| dot | Whether to show red dot | *boolean* | - | - |
-| info | Content of badge in the upper right corner of icon | *string \| number* | - | - |
+| info | Content of the badge | *string \| number* | - | - |
| url | Link | *string* | - | - |
| to | Target route of the link, same as to of vue-router | *string \| object* | - | - |
| replace | If true, the navigation will not leave a history record | *boolean* | `false` | - |
diff --git a/src/tabbar/README.zh-CN.md b/src/tabbar/README.zh-CN.md
index efc322e26..c83197da8 100644
--- a/src/tabbar/README.zh-CN.md
+++ b/src/tabbar/README.zh-CN.md
@@ -57,7 +57,9 @@ export default {
}
```
-### 显示徽标
+### 提示信息
+
+设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标
```html
@@ -168,8 +170,8 @@ export default {
|------|------|------|------|------|
| name | 标签名称,作为匹配的标识符 | *string \| number* | 当前标签的索引值 | - |
| icon | 图标名称或图片链接,可选值见 [Icon 组件](/#/zh-CN/icon)| *string* | - | - |
-| dot | 是否显示小红点 | *boolean* | - | - |
-| info | 图标右上角徽标提示的内容 | *string \| number* | - | - |
+| dot | 是否显示图标右上角小红点 | *boolean* | `false` | - |
+| info | 图标右上角徽标的内容 | *string \| number* | - | - |
| url | 点击后跳转的链接地址 | *string* | - | - |
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - | - |
| replace | 跳转时是否替换当前页面历史 | *boolean* | `false` | - |
diff --git a/src/tabbar/demo/index.vue b/src/tabbar/demo/index.vue
index 249f43431..39d522a57 100644
--- a/src/tabbar/demo/index.vue
+++ b/src/tabbar/demo/index.vue
@@ -94,7 +94,7 @@
export default {
i18n: {
'zh-CN': {
- badge: '显示徽标',
+ badge: '提示信息',
customIcon: '自定义图标',
customColor: '自定义颜色',
matchByName: '通过名称匹配'