繁体   English   中英

Salesforce闪电组件

[英]Salesforce Lightning Component

我正在创建一个Salesforce闪电组件,以列出当前登录用户的潜在客户。

我设法编写了以下代码,但是当我将组件添加到页面并对其进行预览时,我看不到任何潜在客户。

<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
 <div class="slds"> 

<table class="slds-table slds-table--bordered slds-table--striped">
    <thead>
        <tr>
            <th scope="col"><span class="slds-truncate">Company</span></th>
            <th scope="col"><span class="slds-truncate">Annual Revenue</span></th>
        </tr>
    </thead>
    <tbody>
        <aura:iteration items="{!v.leads}" var="lead">
            <tr>
                <td>{!lead.Company}</td>
                <td>{!lead.AnnualRevenue}</td>
            </tr>
        </aura:iteration>
    </tbody>
</table>
    </div>

如果有人能告诉我我做错了那将是很棒的。 谢谢

您可以按照显示联系人列表的教程进行操作,并将逻辑替换为潜在客户

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm

这可能是因为

  1. 您尚未在闪电组件上添加控制器。

     <aura:component implements="forceCommunity:availableForAllPageTypes" controller="ContactController" access="global" > 
  2. 您尚未声明在迭代中使用的属性“ leads”。

     <aura:attribute name="leads" type="Lead[]"/> 
  3. 您尚未设置从Apex控制器获取的“线索”属性。

     controller.set("v.leads", variableWithLeadsList); 
  4. 您尚未从Apex控制器获取数据。 在这种情况下,如Rajdeep Dua所述, https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm链接说明了整个过程,如果您替换Contact,将为您提供帮助与铅。

暂无
暂无

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

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