Description of the problem:
uni-app WeChat applet, the page slides to the bottom, and onReachBottom does not take effect
code:
pages.json
configure
{
"path": "",
"style": {
"navigationBarTitleText": "列表",
"onReachBottomDistance": 100 // 重点
}
}
onReachBottom
Pages using :
import { onReachBottom } from '@dcloudio/uni-app'
onReachBottom(() => {
// 你的代码逻辑
if (parameters.value.current >= pages.value) { return }
parameters.value.current += 1
toSearch.value()
})
<style lang="scss" scoped>
.container {
height: 100%;
min-height: 100.1vh; // 重点
overflow-y: scroll;
}
</style>
Summary:
outermost container settingsmin-height: 100.1vh