-
-
Save arun12209/1d80a725667ea4398d9241d58a5deca9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div>{message}</div> | |
</template> | |
<script> | |
import { LightningElement } from 'lwc'; | |
export default class EventHandlingComponent extends LightningElement { | |
message; | |
connectedCallback() { | |
this.addEventListener('myevent', this.handleEvent); | |
} | |
handleEvent(event) { | |
this.message = event.detail.message; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment