Add two-way binding support to Accordion

pull/12/head
cagataycivici 2019-05-23 16:28:09 +03:00
parent a1116063fd
commit e5c9562a0a
2 changed files with 5 additions and 3 deletions

View File

@ -18,8 +18,10 @@ export default {
this.tabs.forEach(tab => tab.d_active = false);
}
tab.d_active = !tab.d_active;
let eventName = !tab.active ? 'tab-close' : 'tab-open';
const newActiveState = !tab.d_active;
tab.d_active = newActiveState;
tab.$emit('update:active', newActiveState);
let eventName = newActiveState ? 'tab-open' : 'tab-close';
this.$emit(eventName, {
originalEvent: event,
tab: tab