Fixed #1015 - Feature Request: Add "tab-click" to Event from TabView
parent
179d947b26
commit
61a7b2b490
|
@ -6,7 +6,8 @@ interface TabViewProps {
|
||||||
|
|
||||||
declare class TabView {
|
declare class TabView {
|
||||||
$props: TabViewProps;
|
$props: TabViewProps;
|
||||||
$emit(eventName: 'tab-change', e: { originalEvent: Event, tab: any }): this;
|
$emit(eventName: 'tab-change', e: { originalEvent: Event, index: number }): this;
|
||||||
|
$emit(eventName: 'tab-click', e: { originalEvent: Event, index: number }): this;
|
||||||
$slots: {
|
$slots: {
|
||||||
'': VNode[];
|
'': VNode[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {DomHandler} from 'primevue/utils';
|
||||||
import Ripple from 'primevue/ripple';
|
import Ripple from 'primevue/ripple';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ['update:activeIndex', 'tab-change'],
|
emits: ['update:activeIndex', 'tab-change', 'tab-click'],
|
||||||
props: {
|
props: {
|
||||||
activeIndex: {
|
activeIndex: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
@ -56,6 +56,11 @@ export default {
|
||||||
index: i
|
index: i
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$emit('tab-click', {
|
||||||
|
originalEvent: event,
|
||||||
|
index: i
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onTabKeydown(event, i) {
|
onTabKeydown(event, i) {
|
||||||
if (event.which === 13) {
|
if (event.which === 13) {
|
||||||
|
|
|
@ -221,9 +221,16 @@ export default {
|
||||||
<tr>
|
<tr>
|
||||||
<td>tab-change</td>
|
<td>tab-change</td>
|
||||||
<td>event.originalEvent: Browser event <br/>
|
<td>event.originalEvent: Browser event <br/>
|
||||||
event.tab: Selected tab
|
event.index: Index of the selected tab
|
||||||
</td>
|
</td>
|
||||||
<td>Callback to invoke when an active tab is changed.</td>
|
<td>Callback to invoke when an active tab is changed.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>tab-click</td>
|
||||||
|
<td>event.originalEvent: Browser event <br/>
|
||||||
|
event.index: Index of the clicked tab
|
||||||
|
</td>
|
||||||
|
<td>Callback to invoke when an active tab is clicked.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue