Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AccordionHeader Component Using Provide/Inject
Vue.component('accordion-header', {
inject: ['accordionItemState'],
template: `
<h2 class="accordion-header">
<button @click="accordionItemState.expanded = !accordionItemState.expanded">
{{ accordionItemState.expanded ? '▼' : '►' }}
<slot></slot>
</button>
</h2>
`
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.