From f613cd4e3d3e5d6c689767fa7d9ec7aa8a72bb46 Mon Sep 17 00:00:00 2001 From: ShuaiKang Zhang Date: Fri, 20 Sep 2019 16:17:01 +0800 Subject: [PATCH] feat(GridItem): add info & dot props (#2073) --- example/pages/grid/index.wxml | 7 +++++++ packages/grid-item/index.ts | 2 ++ packages/grid-item/index.wxml | 2 +- packages/grid/README.md | 13 +++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/example/pages/grid/index.wxml b/example/pages/grid/index.wxml index 1d74039c..54e36837 100644 --- a/example/pages/grid/index.wxml +++ b/example/pages/grid/index.wxml @@ -36,3 +36,10 @@ + + + + + + + diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts index 704c1765..9a4cf918 100644 --- a/packages/grid-item/index.ts +++ b/packages/grid-item/index.ts @@ -14,6 +14,8 @@ VantComponent({ props: { icon: String, + dot: Boolean, + info: null, text: String, useSlot: Boolean }, diff --git a/packages/grid-item/index.wxml b/packages/grid-item/index.wxml index 46d52fdb..4f8bb75f 100644 --- a/packages/grid-item/index.wxml +++ b/packages/grid-item/index.wxml @@ -7,7 +7,7 @@ - + diff --git a/packages/grid/README.md b/packages/grid/README.md index 280bac14..17f62a63 100644 --- a/packages/grid/README.md +++ b/packages/grid/README.md @@ -96,6 +96,17 @@ ``` +### 提示信息 + +设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标 + +```html + + + + +``` + ## API ### Grid Props @@ -116,6 +127,8 @@ |-----------|-----------|-----------|-------------|-------------| | text | 文字 | *string* | - | - | | icon | 图标名称或图片链接,可选值见 [Icon 组件](/#/icon) | *string* | - | - | +| dot | 是否显示图标右上角小红点 | *boolean* | `false` | - | +| info | 图标右上角徽标的内容 | *string \| number* | - | - | | url | 点击后跳转的链接地址 | *string* | - | - | | link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | *string* | `navigateTo` | - |