list 的内容有吗,如果高度不够的话也不会滚动到 #test 的位置。另外一个就是先去赋值 list 的值,然后再去设置 scrollTo 的值,分两次赋值(同时确定好 list 的已经更新完毕了)。 本文参与了SegmentFault 思否面试闯关挑战赛,欢迎正在阅读的你也加入。 有用 回复 3131975015: 谢谢 提醒我了 回复2023-03-21 ...
<scroll-view scroll-y="true" style="height:{{height}}rpx;background:#eef3f7" scroll-into-view="bottom"> //这里要循环输出一些组件 <view wx:for="{{chat_size}}" wx:for-item="item"> <template is="dialog_mode" data="{{...item}}"></template> </view> <view class="bottom_view"...
scroll-into-view设置成最下面view的id