Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AccordionItem Component Using Provide/Inject
Vue.component('accordion-item', {
data () {
return {
sharedState: {
expanded: false
}
}
},
provide () {
return {
accordionItemState: this.sharedState
}
},
render (createElement) {
return createElement(
'div',
{ class: 'accordion-item' },
this.$slots.default
)
}
})
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.