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/engine/element-api/__CreateComponent.md.
Lynx
  • 简体中文
  • __CreateComponent

    介绍

    创建 ComponentElement 对象。

    语法

    __CreateComponent(componentParentUniqueID: number, componentID: string, cssID: Number, entryName: string, name: string, path: string, config: Record<string, any>|null|undefined, info: Record<string, any>|null|undefined): Element;

    参数

    Key说明
    parentComponentUniqueID指创建该 Element的 ComponentElement 的 Unique Component ID,是一个 number。
    componentID前端框架设置给 ComponentElement 的 componentID,是大小写敏感的字符串。
    cssIDCSSFragment id,是一个 number 类型。
    entryName为当前 ComponentElement 所处的 Lazy Bundle 的 schema 信息,是一个大小写敏感的字符串。
    name为当前 ComponentElement 的前端定 name,是一个大小写敏感的字符串。
    path为当前 ComponentElement 的前端 path,是一个大小写敏感的字符串。
    config为当前 ComponentElement 的 config。
    infoComponentElement 创建时所需的一些额外信息,该参数可以省略。

    返回值

    返回 ComponentElement。

    示例

    前端框架可以按下如下的方法创建

    // main-thread.js
    let element = __CreateComponent(0, '1', 1, '', 'name', 'path', {}, {});
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。