feat(GridItem): add badge prop, mark info prop as deprecated

This commit is contained in:
chenjiahan
2020-03-17 21:01:01 +08:00
parent 0dea9e2cb1
commit db94b20c82
4 changed files with 17 additions and 14 deletions
+5 -4
View File
@@ -103,14 +103,14 @@ Vue.use(GridItem);
</van-grid>
```
### 提示信息
### 徽标提示
设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标
设置`dot`属性后,会在图标右上角展示一个小红点。设置`badge`属性后,会在图标右上角展示相应的徽标
```html
<van-grid :column-num="2">
<van-grid-item icon="home-o" text="文字" dot />
<van-grid-item icon="search" text="文字" info="99+" />
<van-grid-item icon="search" text="文字" badge="99+" />
</van-grid>
```
@@ -136,7 +136,8 @@ Vue.use(GridItem);
| icon | [图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
| icon-prefix `v2.5.3` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | *string* | `van-icon` |
| dot `v2.2.1` | 是否显示图标右上角小红点 | *boolean* | `false` |
| info `v2.2.1` | 图标右上角徽标的内容 | *number \| string* | - |
| badge `v2.5.6` | 图标右上角徽标的内容 | *number \| string* | - |
| info `2.2.1` | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | *number \| string* | - |
| url | 点击后跳转的链接地址 | *string* | - |
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - |
| replace | 是否在跳转时替换当前页面历史 | *boolean* | `false` |