docs(all): improve type docs for event

This commit is contained in:
Manu Mtz.-Almeida
2018-12-28 20:12:54 +01:00
committed by Manu MA
parent b3316d480f
commit 3d656ac312
74 changed files with 380 additions and 371 deletions

View File

@ -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

View File

@ -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) {