Another Salesforce blog!!!

Salesforce, Apex

Conditional Rendering in LWC

HTML:



JS:

import { LightningElement } from 'lwc';

export default class HelloConditionalRendering extends LightningElement {
    isVisible = false
    name
    handleClick(){
        this.isVisible = true
    }

    changeHandler(event){
        this.name = event.target.value
    }

    get helloMethod(){
        return this.name === 'hello'
    }

}

Leave a Reply

Your email address will not be published. Required fields are marked *