Lightning Component Attributes

Attribute used in lightning Component . The type in the attribute component can be a custom object, standard object, List, String, Integer, etc.

<aura:component implements="force:appHostable"
 description="HelloLightning">
    <aura:attribute name="FirstName" type="String" default="潇洒写一回" />
    <aura:attribute name="Age" type="Integer" default="18"/>
    <aura:attribute name="isMale" type="Boolean" default="true"/>

    <p>博主 is {!v.FirstName}</p>
    <p>{!v.FirstName} is {!v.Age} Years Old.</p>
    <p>{!v.FirstName} is male = {!v.isMale}</p>
    
</aura:component>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325894141&siteId=291194637