Tuesday, 19 December 2023

LWC Parent to Child Primitive Data Communication

 <template>


<c-parenttochildalertcomponent


  message = "I got the data"


  card-heading = "Parent to Child primitive data communication"


  number = 20


  is-valid >


</c-parenttochildalertcomponent>


</template>


-------------------------------------------------------


parenttochildalertcomponent 

<template>

<lightning-card  variant="Narrow"   icon-name="standard:account">

    <div>

        {message} 

        {cardHeading}

        {number}

        {isValid}

    </div>

</lightning-card>

</template>


import { LightningElement,api } from 'lwc';

export default class Parenttochildalertcomponent extends LightningElement {

@api message

@api cardHeading

@api number

@api isValid 

}

No comments:

Post a Comment