feat(vue): support for ion-tabs (#17678)

* Add ion-tabs support, QOL fixes

* Fix @ionic/core version, rebuild core to include docs

* Update router

* Add support for IonTabsWillChange and IonTabsDidChange events

* Update usage docs

* Merge core and user provided click handlers in ion-tab-button

* rename file to be consistent
This commit is contained in:
Michael Tintiuc
2019-03-22 16:56:53 +02:00
committed by Mike Hartington
parent 439b10e10d
commit ee7167512f
9 changed files with 347 additions and 171 deletions

View File

@ -3,6 +3,7 @@ import { PluginFunction } from 'vue';
import { RouterArgs, VueWindow } from './interfaces';
import IonVueRouter from './components/ion-vue-router.vue';
import IonVueRouterTransitionless from './components/ion-vue-router-transitionless.vue';
import { BackButtonEvent } from '@ionic/core';
const vueWindow = window as VueWindow;
const inBrowser: boolean = typeof window !== 'undefined';
@ -37,6 +38,13 @@ export default class Router extends _VueRouter {
// Extend the existing history object
this.extendHistory();
// Listen to Ionic's back button event
document.addEventListener('ionBackButton', (e: Event) => {
(e as BackButtonEvent).detail.register(0, () => {
this.back();
});
});
}
extendHistory(): void {