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/before-publish-event-add.md.
Lynx
  • 简体中文
  • BeforePublishEvent: add() method

    add 方法可以被用来注册对某个元件事件的监听。

    语法

    add(name: string, listener: () => {}, context?: BaseInstance): BeforePublishEvent;

    参数

    name

    name: string;

    指定需要监听的元件事件的名称。

    listener

    listener: () => {};

    指定监听回调。

    context

    context?: BaseInstance

    前端自定义 componentcard 实例。

    返回值

    BeforePublishEvent 对象。

    兼容性

    LCD tables only load in the browser

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