5 回复
<scroll-view class=“scrool-view” style=“height: {{ winHeight }}px” scroll-y=“true” scroll-with-animation=“true” scroll-into-view="{{ scrolltop }}" enable-back-to-top=“true”>
</scroll-view>
winHeight :
wx.getSystemInfo({ success(res) { that.setData({ winHeight: res.windowHeight - 150, }); }, }); |
scrolltop
let ch = { 'text' : word, 'time' : new Date().getTime(), 'orientation' : orientation }; chatListData.push(ch); wx.setStorageSync( 'chatList' , chatListData); var charlenght = chatListData.length; that.setData({ chatList: chatListData, scrolltop: "roll" + charlenght }); |
@sincere 试试把!