Switch 组件: 个人建议加了动画效果 (#59)

This commit is contained in:
BosenY 2017-07-25 15:47:31 +08:00 committed by 张敏
parent 86d6b7097f
commit 765a97106a
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@
:maxlength="maxlength"
:disabled="disabled"
:readonly="readonly">
<van-icon v-if="icon" :name="icon" class="van-field__icon" @click="onIconClick"></van-icon>
<van-icon v-if="icon && currentValue" :name="icon" class="van-field__icon" @click="onIconClick"></van-icon>
</van-cell>
</template>

View File

@ -1,7 +1,7 @@
@import './mixins/border_retina.css';
@component-namespace van {
@b switch {
@b switch {
height: 31px;
width: 51px;
display: inline-block;
@ -24,6 +24,7 @@
left: 1px;
top: 1px;
z-index: 2;
transition: transform .3s;
&::after {
@mixin border-retina (top, right, bottom, left), rgba(0, 0, 0, .1);
border-radius: 27px;