perf(Cell): 优化左右图标对齐 @rex-zsd (#763)

This commit is contained in:
rex 2018-10-16 14:11:44 +08:00 committed by neverland
parent 8e7a9790aa
commit c7d6ed66f6
2 changed files with 10 additions and 1 deletions

View File

@ -45,6 +45,13 @@
vertical-align: middle; vertical-align: middle;
} }
&__left-icon-wrap,
&__right-icon-wrap {
display: flex;
align-items: center;
height: 24px;
}
&__left-icon { &__left-icon {
font-size: 16px !important; font-size: 16px !important;
line-height: 24px; line-height: 24px;

View File

@ -1,11 +1,12 @@
<view <view
class="{{ cellClass }}" class="{{ cellClass }}"
style="{{ customStyle }}" style="{{ customStyle }}"
bind:tap="onClick" bind:tap="onClick"
> >
<van-icon <van-icon
wx:if="{{ icon }}" wx:if="{{ icon }}"
name="{{ icon }}" name="{{ icon }}"
class="van-cell__left-icon-wrap"
custom-class="van-cell__left-icon" custom-class="van-cell__left-icon"
/> />
<slot wx:else name="icon" /> <slot wx:else name="icon" />
@ -29,6 +30,7 @@
<van-icon <van-icon
wx:if="{{ isLink }}" wx:if="{{ isLink }}"
name="arrow" name="arrow"
class="van-cell__right-icon-wrap"
custom-class="van-cell__right-icon" custom-class="van-cell__right-icon"
/> />
<slot wx:else name="right-icon" /> <slot wx:else name="right-icon" />