Why the onPullDownRefresh Setting in WeChat Miniprogram Doesn't Work

Translation Notice
This article was machine-translated using DeepSeek-R1.

  • Original Version: Authored in Chinese by myself
  • Accuracy Advisory: Potential discrepancies may exist between translations
  • Precedence: The Chinese text shall prevail in case of ambiguity
  • Feedback: Technical suggestions regarding translation quality are welcomed

Simply having onPullDownRefresh isn’t enough - you must configure:

  • For a single page requiring onPullDownRefresh, set "enablePullDownRefresh": true in the corresponding page’s json file. Example:
1
2
3
4
5
6
7
{
  "backgroundTextStyle": "light",
  "navigationBarBackgroundColor": "#fff",
  "navigationBarTitleText": "Demo Page",
  "navigationBarTextStyle": "black",
  "enablePullDownRefresh": true
}
  • If all pages require onPullDownRefresh, either set "enablePullDownRefresh": true for each page individually, or configure it in app.json:
1
2
3
4
5
6
{
    ...
    "window": {
        "enablePullDownRefresh": true
    }
}
Built with Hugo
Theme Stack designed by Jimmy