-
-
Save arun12209/70c087d3f5576744fd041b73701a4f60 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> | |
<button onclick={toggleVisibility}>Toggle</button> | |
<template if:true={isVisible}> | |
<div>This element is visible</div> | |
</template> | |
</div> | |
</template> | |
<script> | |
import { LightningElement, track } from 'lwc'; | |
export default class VisibilityToggle extends LightningElement { | |
@track isVisible = false; | |
toggleVisibility() { | |
this.isVisible = !this.isVisible; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment