For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/lynx-api/lynx/lynx-before-publish-event.md.
Lynx
  • 简体中文
  • BeforePublishEvent

    lynx.beforePublishEvent 用于注册/移除对某个元件事件的监听。

    实例方法

    BeforePublishEvent.add()

    注册对某个元件事件的监听。

    BeforePublishEvent.remove()

    移除对某个元件事件的监听。

    示例

    注册/移除对某个元件事件的监听。

    // 注册对 tap 事件的监听
    lynx.beforePublishEvent.add('tap', this.handleTap);
    
    // 移除对 tap 事件的监听
    lynx.beforePublishEvent.remove('tap', this.handleTap);

    注意事项

    由于这是一个后台线程的切面接口,所以要求元件需要绑定相应事件并且触发,这样该切面接口才能监听到该元件事件。

    兼容性

    LCD tables only load in the browser

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。