簡體   English   中英

是否可以在自定義閃電應用程序中使用Lightning應用程序交換組件?

[英]Is It possible to use Lightning app exchange components in custom lightning app?

我從應用程序交換安裝了一個閃電組件,現在我想在我的自定義閃電應用程序中使用該組件

可能嗎??

<aura:app>
//code for adding components

</aura:app>

如果您正在使用組件:

<aura:component >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>     
    {!v.body}    
</aura:component>

並在控制器中(例如,“ mvc:CalendarComponent”,將您的組件放在此處):

doInit : function(component, event, helper) {
    $A.createComponent(
        "mvc:CalendarComponent",
        {

        },
        function(newCmp){
            if (component.isValid()) {                    
                component.set("v.body", newCmp);
            }
        }
    );
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM