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

时间:2016-01-15 20:05:26

标签: salesforce components lightning

我从app exchange安装了一个闪电组件,现在我想在我的自定义闪电应用程序中使用该组件

可能吗?

<aura:app>
//code for adding components

</aura:app>

1 个答案:

答案 0 :(得分:1)

如果您正在使用组件:

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

在控制器中(&#34; mvc:CalendarComponent&#34;例如,将组件放在此处):

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

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