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