Fixed params

pull/3/head
cagataycivici 2018-12-13 23:39:27 +03:00
parent 47c106c413
commit 29a3d45695
1 changed files with 5 additions and 4 deletions

View File

@ -31,6 +31,7 @@ export default {
this.activateTab(index); this.activateTab(index);
this.$emit('tabchange', { this.$emit('tabchange', {
originalEvent: event,
tab: tab, tab: tab,
index: index index: index
}); });
@ -42,9 +43,9 @@ export default {
this.tabs[i].active = (i === index); this.tabs[i].active = (i === index);
} }
}, },
onTabKeydown(event, index) { onTabKeydown(event, tab, index) {
if (event.which === 13) { if (event.which === 13) {
this.onTabClick(index); this.onTabClick(event, tab, index);
} }
} }
}, },
@ -55,8 +56,8 @@ export default {
{ {
this.tabs.map((tab, i) => { this.tabs.map((tab, i) => {
return ( return (
<li role="presentation" key={tab.header} class={{'p-highlight': (this.d_activeTabIndex === i), 'p-disabled': tab.disabled}}> <li role="presentation" key={tab.header||i} class={{'p-highlight': (this.d_activeTabIndex === i), 'p-disabled': tab.disabled}}>
<a role="tab" on-click={event => this.onTabClick(event, tab, i)} on-keydown={event => this.onTabKeydown(event, i)} tabindex={tab.disabled ? null : '0'}> <a role="tab" on-click={event => this.onTabClick(event, tab, i)} on-keydown={event => this.onTabKeydown(event, tab, i)} tabindex={tab.disabled ? null : '0'}>
{tab.header && <span class="p-tabview-title">{tab.header}</span>} {tab.header && <span class="p-tabview-title">{tab.header}</span>}
{tab.$slots.header} {tab.$slots.header}
</a> </a>