mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
chore(routing): update routing package
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { NavContainer } from '@ionic/core';
|
||||
import { PublicNav } from '@ionic/core';
|
||||
|
||||
export class App {
|
||||
|
||||
@ -15,15 +15,15 @@ export class App {
|
||||
return isScrollingImpl(this);
|
||||
}
|
||||
|
||||
getRootNavs(): NavContainer[] {
|
||||
getRootNavs(): PublicNav[] {
|
||||
return getRootNavsImpl(this);
|
||||
}
|
||||
|
||||
getActiveNavs(rootNavId?: number): NavContainer[] {
|
||||
return getActiveNavsImpl(this, rootNavId);
|
||||
getTopNavs(rootNavId?: number): PublicNav[] {
|
||||
return getTopNavsImpl(this, rootNavId);
|
||||
}
|
||||
|
||||
getNavByIdOrName(nameOrId: number | string): NavContainer {
|
||||
getNavByIdOrName(nameOrId: number | string): PublicNav {
|
||||
return getNavByIdOrNameImpl(this, nameOrId);
|
||||
}
|
||||
}
|
||||
@ -42,14 +42,14 @@ export function getRootNavsImpl(app: App) {
|
||||
return [];
|
||||
}
|
||||
|
||||
export function getActiveNavsImpl(app: App, rootNavId?: number): NavContainer[] {
|
||||
if (app._element && app._element.getActiveNavs) {
|
||||
return app._element.getActiveNavs(rootNavId);
|
||||
export function getTopNavsImpl(app: App, rootNavId?: number): PublicNav[] {
|
||||
if (app._element && app._element.getTopNavs) {
|
||||
return app._element.getTopNavs(rootNavId);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
export function getNavByIdOrNameImpl(app: App, nameOrId: number | string): NavContainer {
|
||||
export function getNavByIdOrNameImpl(app: App, nameOrId: number | string): PublicNav {
|
||||
if (app._element && app._element.getNavByIdOrName) {
|
||||
return app._element.getNavByIdOrName(nameOrId);
|
||||
}
|
||||
|
||||
@ -93,13 +93,27 @@ export class NavController implements PublicNav {
|
||||
return false;
|
||||
}
|
||||
|
||||
getFirstView(): PublicViewController {
|
||||
if (this.element.getFirstView) {
|
||||
return this.element.getFirstView();
|
||||
first(): PublicViewController {
|
||||
if (this.element.first) {
|
||||
return this.element.first();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
last(): PublicViewController {
|
||||
if (this.element.last) {
|
||||
return this.element.last();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
getViews(): PublicViewController[] {
|
||||
if (this.element.getViews) {
|
||||
return this.element.getViews();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
getChildNavs(): PublicNav[] {
|
||||
if (this.element.getChildNavs) {
|
||||
return this.element.getChildNavs();
|
||||
|
||||
Reference in New Issue
Block a user