Coder Social home page Coder Social logo

Comments (1)

JuneAndGreen avatar JuneAndGreen commented on June 2, 2024

你应该是监听不到 getuserinfo 事件吧,这个和 ant-mobile 那些应该没啥关系,是 react 自己做了限制,无法从标准节点里监听 customEvent。

处理手段大致有两种:
1、是手动使用 addEventListener/removeEventListener 来处理事件监听/移除
2、使用 kbone 提供的批量监听事件的语法糖:https://wechat-miniprogram.github.io/kbone/docs/guide/advanced.html#%E6%89%B9%E9%87%8F%E8%AE%BE%E7%BD%AE%E4%BA%8B%E4%BB%B6%E7%9B%91%E5%90%AC%E5%99%A8

第二个问题,如果是要用小程序原生的实现,要加配置:

上拉加载 - https://wechat-miniprogram.github.io/kbone/docs/config/#global-reachbottom
下拉刷新 - https://wechat-miniprogram.github.io/kbone/docs/config/#global-pulldownrefresh

配在 global 里是所有页面通配,配在 pages 里则可以指定页面配置。然后 window 上走正常的事件监听即可:
image

如果是 Web 端,就要自己实现了,kbone 不处理任何 Web 端的代码。

from kbone-template-react.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.