Created
April 8, 2021 17:35
-
-
Save Wolfr/7a88068909f5cfc5df6473acc658ab48 to your computer and use it in GitHub Desktop.
Accordion in Ember
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
import Component from '@glimmer/component'; | |
import { action } from '@ember/object'; | |
import { tracked } from '@glimmer/tracking'; | |
import { guidFor } from '@ember/object/internals'; | |
export default class Accordion extends Component { | |
@tracked isActive = false | |
accordionId = 'accordion-' + guidFor(this); | |
@action | |
toggleAccordion() { | |
this.isActive = !this.isActive | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment