remaxjs / remax

使用真正的 React 构建跨平台小程序
https://remaxjs.github.io/remax/
MIT License
4.57k stars 364 forks source link

[问题]wechat的ScrollView组件没有触发onScroll #1922

Closed mathxlee closed 2 years ago

mathxlee commented 2 years ago

问题描述 如题所述,目前我使用的是typescript,以及目前的整个JSX的最外层都用的是scrollview 滚动的时候onScroll没有被触发

https://remaxjs.org/guide/one/#%E4%BD%BF%E7%94%A8%E6%96%87%E4%BB%B6%E5%90%8D%E5%90%8E%E7%BC%80%E5%8C%BA%E5%88%86%E4%B8%8D%E5%90%8C%E5%B9%B3%E5%8F%B0%E4%BB%A3%E7%A0%81 这个例子似乎没有针对tsx的?

watsonhaw5566 commented 2 years ago

能否发一段你的srcollview 的代码看看,谢谢

mathxlee commented 2 years ago
image

@watsonhaw5566

watsonhaw5566 commented 2 years ago

https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html

微信里面的scroll-view 是需要给一个高度的,检查一下代码就好了。 onScroll是可以正常运行的。

mathxlee commented 2 years ago

感谢解答,问题解决了,设置了高度而不是自己撑开的高度就解决问题了!