<!--pages/list/list.wxml-->
<!-- scroll-x:允许横向滚动 -->
<!-- scroll-y:允许纵向滚动 -->
<!-- 注意:纵向滚动需要给scroll-view一个固定的高度 -->
<scroll-view class="test1" scroll-y>
<view>A</view>
<view>B</view>
<view>C</view>
</scroll-view>
/* pages/list/list.wxss */
.test1 view{
height: 100px;
width: 100px;
text-align: center;
line-height: 100px;
}
.test1 :nth-child(1){
background-color: lightpink;
}
.test1 :nth-child(2){
background-color: lightgreen;
}
.test1 :nth-child(3){
background-color: lightblue;
}
.test1{
border: 1px solid red;
/* 给scroll-view一个固定高度 */
height: 120px;
width: 100px;
}