Created
September 25, 2018 17:14
-
-
Save jonathanharrell/8720766b5ee7dd4f18112269616a9fa6 to your computer and use it in GitHub Desktop.
AccordionPanel Component Using Provide/Inject
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
Vue.component('accordion-panel', { | |
inject: ['accordionItemState'], | |
template: ` | |
<div class="accordion-panel" :class="{ expanded: accordionItemState.expanded }"> | |
<slot></slot> | |
</div> | |
` | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment