[Improvement] Cell: optimize left icon (#893)

This commit is contained in:
neverland
2018-04-19 16:10:37 +08:00
committed by GitHub
parent 24b95af824
commit 0192eb7ee8
10 changed files with 101 additions and 114 deletions

View File

@@ -9,12 +9,12 @@
}"
@click="onClick"
>
<div class="van-cell__title" v-if="title || icon || $slots.title || $slots.icon">
<slot name="icon">
<icon v-if="icon" :name="icon" />
</slot>
<slot name="icon">
<icon v-if="icon" class="van-cell__left-icon" :name="icon" />
</slot>
<div class="van-cell__title" v-if="title || $slots.title">
<slot name="title">
<span class="van-cell__text" v-text="title" />
<span v-text="title" />
<div class="van-cell__label" v-if="label" v-text="label" />
</slot>
</div>

View File

@@ -90,7 +90,7 @@ export default {
if (this.lockScroll) {
if (!context.lockCount) {
document.body.classList.add('van-overflow-hidden');
on(document, 'touchstart', this.onTouchStart);
on(document, 'touchstart', this.touchStart);
on(document, 'touchmove', this.onTouchMove);
}
context.lockCount++;
@@ -125,10 +125,6 @@ export default {
}
},
onTouchStart(e) {
this.touchStart(e);
},
onTouchMove(e) {
this.touchMove(e);
const direction = this.deltaY > 0 ? '10' : '01';

View File

@@ -59,14 +59,12 @@
bottom: 0;
z-index: 9999;
padding-left: 15px;
.van-cell__text {
font-size: 16px;
}
font-size: 16px;
.van-icon-add {
color: $blue;
font-size: 20px;
line-height: 1.2;
}
}
}

View File

@@ -24,16 +24,10 @@
background-color: $white;
}
&__title {
.van-icon {
font-size: 16px;
margin-right: 5px;
vertical-align: middle;
}
}
&__text {
vertical-align: middle;
&__left-icon {
font-size: 16px;
line-height: 1.5;
margin-right: 5px;
}
&__label {

View File

@@ -50,18 +50,12 @@
bottom: 0;
z-index: 9999;
padding-left: 15px;
.van-cell__text {
font-size: 16px;
}
font-size: 16px;
.van-icon-add {
color: $blue;
font-size: 20px;
}
&:active {
background-color: $active-color;
line-height: 1.2;
}
}
}

View File

@@ -1,10 +1,6 @@
@import './common/var.css';
.van-switch-cell {
.van-cell__text {
vertical-align: baseline;;
}
.van-switch {
float: right;
}