feat(icon): add_icon_info_class (#5458)

This commit is contained in:
johnsonwong666 2023-07-03 17:08:16 +08:00 committed by GitHub
parent 22acb8ddbc
commit 3d1d27641b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 16 deletions

View File

@ -3,7 +3,7 @@ import { button } from '../mixins/button';
import { link } from '../mixins/link';
VantComponent({
classes: ['icon-class', 'text-class'],
classes: ['icon-class', 'text-class', 'info-class'],
mixins: [link, button],

View File

@ -32,6 +32,7 @@
class-prefix="{{ classPrefix }}"
class="van-goods-action-icon__icon"
custom-class="icon-class"
info-class="info-class"
/>
<slot wx:else name="icon" />
<text class="text-class">{{ text }}</text>

View File

@ -168,6 +168,7 @@ Page({
| ---------- | ---------- |
| icon-class | 图标样式类 |
| text-class | 文字样式类 |
| info-class `v1.10.20` | 图标右上角文字样式类 |
### GoodsActionButton 外部样式类

View File

@ -60,6 +60,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-chat-o"
@ -67,7 +68,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -125,6 +126,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-cart-o"
@ -132,7 +134,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -307,6 +309,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-chat-o"
@ -314,7 +317,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info van-info--dot custom-class"
@ -377,6 +380,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-cart-o"
@ -384,7 +388,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info custom-class"
@ -447,6 +451,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-shop-o"
@ -454,7 +459,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -625,6 +630,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-chat-o"
@ -632,7 +638,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -688,6 +694,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-shop-o"
@ -695,7 +702,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -866,6 +873,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-chat-o"
@ -873,7 +881,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>
@ -929,6 +937,7 @@ exports[`should render demo and match snapshot 1`] = `
<van-icon
class="van-goods-action-icon__icon"
customClass="icon-class"
infoClass="info-class"
>
<wx-view
class="custom-class van-icon van-icon-shop-o"
@ -936,7 +945,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
/>
</wx-view>
</van-icon>

View File

@ -1174,7 +1174,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info van-info--dot custom-class"
@ -1216,7 +1216,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info custom-class"

View File

@ -101,6 +101,7 @@
| 类名 | 说明 |
| ------------ | ------------ |
| custom-class | 根节点样式类 |
| info-class | 图标右上角文字样式类 |
## 常见问题

View File

@ -1,6 +1,7 @@
import { VantComponent } from '../common/component';
VantComponent({
classes: ['info-class'],
props: {
dot: Boolean,
info: null,

View File

@ -9,7 +9,7 @@
wx:if="{{ info !== null || dot }}"
dot="{{ dot }}"
info="{{ info }}"
custom-class="van-icon__info"
custom-class="van-icon__info info-class"
/>
<image
wx:if="{{ computed.isImage(name) }}"

View File

@ -199,7 +199,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info van-info--dot custom-class"
@ -228,7 +228,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info custom-class"
@ -257,7 +257,7 @@ exports[`should render demo and match snapshot 1`] = `
bind:tap="onClick"
>
<van-info
customClass="van-icon__info"
customClass="van-icon__info info-class"
>
<wx-view
class="van-info van-info custom-class"