Add two-way binding support to Accordion
parent
a1116063fd
commit
e5c9562a0a
|
@ -18,8 +18,10 @@ export default {
|
||||||
this.tabs.forEach(tab => tab.d_active = false);
|
this.tabs.forEach(tab => tab.d_active = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
tab.d_active = !tab.d_active;
|
const newActiveState = !tab.d_active;
|
||||||
let eventName = !tab.active ? 'tab-close' : 'tab-open';
|
tab.d_active = newActiveState;
|
||||||
|
tab.$emit('update:active', newActiveState);
|
||||||
|
let eventName = newActiveState ? 'tab-open' : 'tab-close';
|
||||||
this.$emit(eventName, {
|
this.$emit(eventName, {
|
||||||
originalEvent: event,
|
originalEvent: event,
|
||||||
tab: tab
|
tab: tab
|
||||||
|
|
Loading…
Reference in New Issue