mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
docs(all): improve type docs for event
This commit is contained in:
committed by
Manu MA
parent
b3316d480f
commit
3d656ac312
@ -166,12 +166,12 @@ Using tabs with Angular's router is fairly straight forward. Here you only need
|
||||
|
||||
## Events
|
||||
|
||||
| Event | Description | Detail |
|
||||
| ------------------ | -------------------------------------------------------------------------- | ------------------------ |
|
||||
| `ionChange` | Emitted when the tab changes. | {tab: HTMLIonTabElement} |
|
||||
| `ionNavDidChange` | Emitted when the navigation has finished transitioning to a new component. | void |
|
||||
| `ionNavWillChange` | Emitted when the navigation is about to transition to a new component. | void |
|
||||
| `ionNavWillLoad` | Emitted when the navigation will load a component. | void |
|
||||
| Event | Description | Type |
|
||||
| ------------------ | -------------------------------------------------------------------------- | --------------------------------------- |
|
||||
| `ionChange` | Emitted when the tab changes. | `CustomEvent<{tab: HTMLIonTabElement}>` |
|
||||
| `ionNavDidChange` | Emitted when the navigation has finished transitioning to a new component. | `CustomEvent<void>` |
|
||||
| `ionNavWillChange` | Emitted when the navigation is about to transition to a new component. | `CustomEvent<void>` |
|
||||
| `ionNavWillLoad` | Emitted when the navigation will load a component. | `CustomEvent<void>` |
|
||||
|
||||
|
||||
## Methods
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, Element, Event, EventEmitter, Listen, Method, Prop, State } from '@stencil/core';
|
||||
|
||||
import { Config, NavOutlet, RouteID, RouteWrite, TabButtonClickDetail } from '../../interface';
|
||||
import { Config, NavOutlet, RouteID, RouteWrite, TabButtonClickEventDetail } from '../../interface';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-tabs',
|
||||
@ -70,7 +70,7 @@ export class Tabs implements NavOutlet {
|
||||
}
|
||||
|
||||
@Listen('ionTabButtonClick')
|
||||
protected onTabClicked(ev: CustomEvent<TabButtonClickDetail>) {
|
||||
protected onTabClicked(ev: CustomEvent<TabButtonClickEventDetail>) {
|
||||
const { href, tab } = ev.detail;
|
||||
const selectedTab = this.tabs.find(t => t.tab === tab);
|
||||
if (this.useRouter && href !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user