[Improvement] Swipe: optimzie performance (#985)

This commit is contained in:
neverland
2018-05-04 15:21:24 +08:00
committed by GitHub
parent 997780f2f5
commit 2899a4cb8e
4 changed files with 83 additions and 96 deletions

View File

@@ -27,7 +27,7 @@
</demo-block>
<demo-block :title="$t('title4')">
<van-swipe :autoplay="3000" vertical>
<van-swipe :autoplay="3000" vertical class="demo-swipe--vertical">
<van-swipe-item>1</van-swipe-item>
<van-swipe-item>2</van-swipe-item>
<van-swipe-item>3</van-swipe-item>
@@ -79,11 +79,9 @@ export default {
.van-swipe {
cursor: pointer;
height: 140px;
&-item {
color: #fff;
min-height: 140px;
font-size: 20px;
text-align: center;
line-height: 150px;
@@ -107,5 +105,13 @@ export default {
pointer-events: none;
}
}
&--vertical {
height: 200px;
.van-swipe-item {
line-height: 200px;
}
}
}
</style>