Skip to main content
<lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">

            <aura:set attribute="action">

                <lightning:Button Label="View Details" Variant="brand"/>

            </aura:set>

            <p class="slds-p-horizontal-small">

                {!con.FirstName}&nbsp; {!con.LastName} <br/>

                {!con.Phone}

            </p>

        </lightning:card>

For the Above coding i am getting an Error: 

ContactList.cmp: The attribute "action" was not found on the COMPONENT markup://lightning:card: Source.

anyone can help how to solve this.
3 个回答
  1. 2021年1月5日 13:21
    Hi SHAIK MOULALI,

    Please define the <aura:set attribute="action"/> above the lightning:card.

    <aura:set> is used to set the value of an attribute inherited from a parent component, event, or to set the value of the attribute of a component reference.

    Just like this:-

    <aura:set attribute="action"></aura:set>

        <lightning:card footer="{!con.Email}" title="{!con.LastName}" iconName="action:add_contact">

            <lightning:Button Label="View Details" Variant="brand"/>

            <p class="slds-p-horizontal-small">

                {!con.FirstName}&nbsp; {!con.LastName} <br/>

                {!con.Phone}

            </p>

        </lightning:card>

    Please follow the link below for the solution to your question:

    https://www.forcetalks.com/blog/how-to-use-auraset-in-salesforce-lightning/

    Hope this explanation will resolve your query. Mark, it as the best answer if you find it helpful.

    Thanks

    Akshay
0/9000