diff --git a/src/tab/README.md b/src/tab/README.md index 1d64cf9fb..5078acdbf 100644 --- a/src/tab/README.md +++ b/src/tab/README.md @@ -219,7 +219,7 @@ In scrollspy mode, the list of content will be tiled | title | Title | *string* | - | | disabled | Whether to disable tab | *boolean* | `false` | | dot `v2.3.0` | Whether to show red dot on the title | *boolean* | `false` | -| info `v2.3.0` | Content of the badge on the title | *number \| string* | - | +| badge `v2.5.6` | Content of the badge on the title | *number \| string* | - | | name `v2.0.6` | Identifier | *number \| string* | Index of tab | | url `v2.2.1` | Link | *string* | - | | to `v2.2.1` | Target route of the link, same as to of vue-router | *string \| object* | - | diff --git a/src/tab/README.zh-CN.md b/src/tab/README.zh-CN.md index ed88127da..0f7a3c385 100644 --- a/src/tab/README.zh-CN.md +++ b/src/tab/README.zh-CN.md @@ -223,7 +223,8 @@ export default { | title | 标题 | *string* | - | | disabled | 是否禁用标签 | *boolean* | `false` | | dot `v2.3.0` | 是否在标题右上角显示小红点 | *boolean* | `false` | -| info `v2.3.0` | 标题右上角徽标的内容 | *number \| string* | - | +| badge `v2.5.6` | 图标右上角徽标的内容 | *number \| string* | - | +| info `v2.3.0` | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | *number \| string* | - | | name `v2.0.6` | 标签名称,作为匹配的标识符 | *number \| string* | 标签的索引值 | | url `v2.2.1` | 点击后跳转的链接地址 | *string* | - | | to `v2.2.1` | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - | diff --git a/src/tab/index.js b/src/tab/index.js index 045918a53..807fcced3 100644 --- a/src/tab/index.js +++ b/src/tab/index.js @@ -10,8 +10,9 @@ export default createComponent({ props: { ...routeProps, dot: Boolean, - info: [Number, String], name: [Number, String], + info: [Number, String], + badge: [Number, String], title: String, titleStyle: null, disabled: Boolean, diff --git a/src/tabs/index.js b/src/tabs/index.js index d8978f775..2485f0df1 100644 --- a/src/tabs/index.js +++ b/src/tabs/index.js @@ -345,7 +345,7 @@ export default createComponent({ refInFor type={type} dot={item.dot} - info={item.info} + info={isDef(item.badge) ? item.badge : item.info} title={item.title} color={this.color} style={item.titleStyle}