如果 scroll-view 组件同时启用 scroll-x 和 scroll-y, 调用ScrollViewContext 的 scrollTo 方法,只有 top 会生效,left 参数无效。
<scroll-view class="scroll-view" enhanced scroll-x scroll-y style="width: 100vw; height: 100vh;">
<view style="width:200vw;height:200vh;background:gray;box-shadow: inset 0 0 0 10px red;"></view>
</scroll-view>
wx.createSelectorQuery()
.select('.scroll-view')
.node((res) => {
res.node.scrollTo({
top: 100,
left: 100, // left 不生效,除非把组件的 scroll-x 属性删除
})
})
.exec();

测试最新版本试试