diff --git a/packages/icon/README.md b/packages/icon/README.md index 0872f3c92..1f6a7d5c9 100644 --- a/packages/icon/README.md +++ b/packages/icon/README.md @@ -89,6 +89,7 @@ | size `v1.10.20` | 图标大小,如 `20px`,`2em`,默认单位为`px` | _string \| number_ | `inherit` | | custom-style | 自定义样式 | _string_ | - | | class-prefix | 类名前缀 | _string_ | `van-icon` | +| use-info-slot | 是否使用 info slot | _boolean_ | `false` | ### Events @@ -103,6 +104,12 @@ | custom-class | 根节点样式类 | | info-class | 图标右上角文字样式类 | +### Slot + +| 类名 | 说明 | +| ------------ | ------------ | +| info-slot `v1.11.2` | 自定义info内容,开启useInfoSlot有效 | + ## 常见问题 ### 开发者工具上提示 Failed to load font 是什么情况? diff --git a/packages/icon/index.ts b/packages/icon/index.ts index b1ccf4d86..84ca67bd2 100644 --- a/packages/icon/index.ts +++ b/packages/icon/index.ts @@ -13,6 +13,7 @@ VantComponent({ value: 'van-icon', }, name: String, + useInfoSlot: Boolean, }, methods: { diff --git a/packages/icon/index.wxml b/packages/icon/index.wxml index 91b47f914..859c7f96e 100644 --- a/packages/icon/index.wxml +++ b/packages/icon/index.wxml @@ -5,12 +5,15 @@ style="{{ computed.rootStyle({ customStyle, color, size }) }}" bindtap="onClick" > - + + + +