-
-
Save arun12209/21a2a66d5a949e18d420f4da3304e3a0 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> | |
<button onclick={handleClick}>Click me</button> | |
</template> | |
<script> | |
import { LightningElement } from 'lwc'; | |
export default class EventFiringComponent extends LightningElement { | |
handleClick() { | |
const event = new CustomEvent('myevent', { detail: { message: 'Hello World' } }); | |
this.dispatchEvent(event); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment