微信小程序自动滚动到最底部
解决方案
<scroll-view class="comments" scroll-y="true" scroll-into-view="{{scrollLast}}">
<view class="comments-box">
<view class="comments-item" wx:for="{{vlist.comment}}" wx:key="this" id="item{{index + 1}}">
...
</view>
</view>
</scroll-view>
onLoad(options) {
this.getScollBottom();
},
getScollBottom() {
this.setData({
scrollLast: 'item' + this.data.vlist.comment.length
})
},
.comments {
max-height: 440rpx;
}