我被一个不渲染的闪电组件困住了。我立即收到一个奇怪的错误:此页面有错误。您可能只需要刷新它。初始化期间出错 [无法读取未定义的属性“应用”]。
我现在卡了很长时间,无法弄清楚代码有什么问题。在这里你可以看到我的代码:
零件:
<aura:attribute name="recordId" type="String" default='500b000000cOxah' />
<aura:attribute name="case" type="Case" />
<aura:attribute name="tasks" type="Task[]"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<c:CaseActivityTrackerHeader />
<aura:iteration items="{!v.tasks}" var="task">
<c:CaseActivityTrackerTimeline task="{!task}"/>
</aura:iteration>
<aura:iteration items="{!v.tasks}" var="task">
<h3>{!v.task.Subject}</h3>
</aura:iteration>
<h3>{!v.case.Subject}</h3>
<h3>{!v.recordId}</h3>
({
doInit: function(component, event, helper) {
//helper.getCase(component, event);
//helper.getTasks(component, event);
// Set the attribute value.
// You could also fire an event here instead.
component.set("v.recordId", "controller init magic!");
}
})
应用程序
<aura:application extends="force:slds">
<c:CaseActivityTracker />
<!--
<c:camping />
-->
我真的有人可以帮助我!提前致谢 :)