From 29f1628c0077c1646248efba466cb6ccae192ca9 Mon Sep 17 00:00:00 2001 From: rex Date: Wed, 3 Jun 2020 17:36:06 +0800 Subject: [PATCH] feat(grid): add new prop icon-size & badge (#3236) fix #3223 --- example/pages/grid/index.wxml | 2 +- packages/grid-item/index.ts | 3 +++ packages/grid-item/index.wxml | 2 +- packages/grid/README.md | 7 ++++--- packages/grid/index.ts | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/example/pages/grid/index.wxml b/example/pages/grid/index.wxml index 56280724..1f1e0942 100644 --- a/example/pages/grid/index.wxml +++ b/example/pages/grid/index.wxml @@ -46,6 +46,6 @@ - + diff --git a/packages/grid-item/index.ts b/packages/grid-item/index.ts index 1678b601..beaaeeee 100644 --- a/packages/grid-item/index.ts +++ b/packages/grid-item/index.ts @@ -17,6 +17,7 @@ VantComponent({ icon: String, dot: Boolean, info: null, + badge: null, text: String, useSlot: Boolean, }, @@ -44,6 +45,7 @@ VantComponent({ clickable, center, direction, + iconSize, } = data; const width = `${100 / columnNum}%`; @@ -85,6 +87,7 @@ VantComponent({ gutter, clickable, direction, + iconSize, }); }, diff --git a/packages/grid-item/index.wxml b/packages/grid-item/index.wxml index 57a96281..a27c06f1 100644 --- a/packages/grid-item/index.wxml +++ b/packages/grid-item/index.wxml @@ -10,7 +10,7 @@ - + diff --git a/packages/grid/README.md b/packages/grid/README.md index 9ba1d8de..d788a385 100644 --- a/packages/grid/README.md +++ b/packages/grid/README.md @@ -100,12 +100,12 @@ ### 提示信息 -设置`dot`属性后,会在图标右上角展示一个小红点。设置`info`属性后,会在图标右上角展示相应的徽标 +设置`dot`属性后,会在图标右上角展示一个小红点。设置`badge`属性后,会在图标右上角展示相应的徽标 ```html - + ``` @@ -116,6 +116,7 @@ | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | | column-num | 列数 | _number_ | `4` | - | +| icon-size `v1.3.2` | 图标大小,默认单位为`px` | _string_ | `28px` | | gutter | 格子之间的间距,默认单位为`px` | _string \| number_ | `0` | - | | border | 是否显示边框 | _boolean_ | `true` | - | | center | 是否将格子内容居中显示 | _boolean_ | `true` | - | @@ -136,7 +137,7 @@ | text | 文字 | _string_ | - | - | | icon | 图标名称或图片链接,可选值见 [Icon 组件](#/icon) | _string_ | - | - | | dot | 是否显示图标右上角小红点 | _boolean_ | `false` | - | -| info | 图标右上角徽标的内容 | _string \| number_ | - | - | +| badge | 图标右上角徽标的内容 | _string \| number_ | - | - | | url | 点击后跳转的链接地址 | _string_ | - | - | | link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | _string_ | `navigateTo` | - | diff --git a/packages/grid/index.ts b/packages/grid/index.ts index fdc1b32b..d81436c4 100644 --- a/packages/grid/index.ts +++ b/packages/grid/index.ts @@ -41,6 +41,10 @@ VantComponent({ type: String, observer: 'updateChildren', }, + iconSize: { + type: String, + observer: 'updateChildren', + }, }, data: {