mirror of
https://github.com/youzan/vant.git
synced 2025-12-19 01:02:29 +08:00
[Improvement] Cell: optimize left icon (#893)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
@import './common/var.css';
|
||||
|
||||
.van-switch-cell {
|
||||
.van-cell__text {
|
||||
vertical-align: baseline;;
|
||||
}
|
||||
|
||||
.van-switch {
|
||||
float: right;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user