简体   繁体   English

是否可以在自定义闪电应用程序中使用Lightning应用程序交换组件?

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

i installed a lightning component from app exchange ,now i want to use that component in my custom lightning app 我从应用程序交换安装了一个闪电组件,现在我想在我的自定义闪电应用程序中使用该组件

is it possible?? 可能吗??

<aura:app>
//code for adding components

</aura:app>

If you are working with components: 如果您正在使用组件:

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

And in the controller ("mvc:CalendarComponent" as example, put here your 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