list.wxml:
<scroll-view class="container1" scroll-y>
<view>A</view>
<view>B</view>
<view>C</view>
</scroll-view>
list.wxss:
.container1 {
width: 100px;
height: 120px;
border: 1px solid red;
}
.container1 view:nth-child(1) {
background-color: lightgreen;
text-align: center;
line-height: 100px;
}
.container1 view:nth-child(2) {
background-color: lightskyblue;
}
.container1 view:nth-child(3) {
background-color: lightcoral;
}
运行结果