简体   繁体   English

闪电组件未显示在闪电选项卡上

[英]Lightning Component not showing on Lightning Tab

I am not able to see my lightning component when trying to create a lighting tab. 尝试创建照明标签时,看不到我的闪电组件。 Something is wrong with one of the components - 其中一个组件有问题-

I moved the component and tab using salesforce dx and when editing the component. 我在编辑组件时使用salesforce dx移动了组件和选项卡。 I am getting below error. 我正在错误以下。 I seems like one of the component is throwing an error when i am trying to edit the record - 我似乎在尝试编辑记录时组件之一抛出错误-

Error = Review all error messages below to correct your data. 错误=查看下面的所有错误消息以更正您的数据。 You can only create lightning tabs for AuraDefinitionBundles containing a component that implements force:appHostable and has no required attributes without a default value. 您只能为AuraDefinitionBundles创建闪电选项卡,其中包含实现了force:appHostable且没有必需属性且没有默认值的组件。 (Related field: Content) (相关字段:内容)

Observation - When i remove the attribute from parent component and child component than its working and i am able to save the tab. 观察-当我从父组件和子组件中删除该属性而不是其工作属性时,我能够保存该选项卡。 Something is not correct with my component initiation. 我的组件启动有些不正确。

Code in parent Component - 父组件中的代码-

<aura:if isTrue="{!!v.customTab}">
<div aura:id="defaultTabContent" class="slds-show">
    <c:ApiRequestFieldMapping custom="false" objectName="Credit_Report__c"/>
</div>
</aura:if>
<aura:if isTrue="{!v.customTab}">
<div aura:id="customTabContent" class="slds-hide">
    <c:ApiRequestFieldMapping custom="true" listSObjects="
    {!v.listSObjects}" message="Select object from drop-down." 
    messageClass="Info"/>
</div>

Code in Child Component - 子组件中的代码-

<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
<aura:registerEvent name="handleModelVisiblity" type="c:HandleModel"/>
<!-- attributes -->
<aura:attribute name="custom" type="Boolean"/>
<aura:attribute name="objectName" type="String"/>
<aura:attribute name="listSObjects" type="String[]"/>
<aura:attribute name="message" type="String"/>
<aura:attribute name="messageClass" type="String"/> 
<aura:attribute name="listSObjectFields" type="String[]" 
required="false"/>
<aura:attribute name="customObjectName" type="String" 
required="false"/>
<aura:attribute name="listWrapper" 
type="RequestMappingWrapper.MappingRecords[]" required="false"/>

Already Tried - 1. My component is already implementing "force:appHostable" interface. 已经尝试-1.我的组件已经实现了“ force:appHostable”接口。 2. The component us using latest version.(40.0) 3. Have already tried creating the components. 2.我们使用的是最新版本的组件。(40.0)3.已经尝试创建组件。 4. My org has my domain enabled and also have namespace. 4.我的组织启用了我的域,还拥有名称空间。

I have fixed the issue. 我已经解决了这个问题。 I have removed the reference to inner class in one of the attribute. 我已删除其中一个属性对内部类的引用。 Changed "RequestMappingWrapper.MappingRecords[]" to "RequestMappingWrapper[]". 将“ RequestMappingWrapper.MappingRecords []”更改为“ RequestMappingWrapper []”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM