Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created January 15, 2023 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/1d80a725667ea4398d9241d58a5deca9 to your computer and use it in GitHub Desktop.
Save arun12209/1d80a725667ea4398d9241d58a5deca9 to your computer and use it in GitHub Desktop.
<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