メインコンテンツまでスキップ
Version: v6

ion-nav

shadow

コンテンツ

Navは、任意のコンポーネントをロードし、スタックに新しいコンポーネントを追加するためのスタンドアロンコンポーネントです

RouterOutletとは異なり、Navは特定のルーターに関連付けられていません。つまり、Navコンポーネントをロードして他のコンポーネントをスタックに追加しても、ルーター全体のアプリケーションには影響しません。これは、独自のサブナビゲーションを必要とするが、アプリのURLに縛られないモーダルを持つことができるユースケースに適しています。

Interfaces

必須ではありませんが、このコンポーネントから発行される Ionic イベントでより強く型付けを行うために、CustomEvent インターフェースの代わりにこのインターフェースを使用することが可能です。

interface NavCustomEvent extends CustomEvent {
target: HTMLIonNavElement;
}

プロパティ

animated

DescriptionIf true, the nav should animate the transition of components.
Attributeanimated
Typeboolean
Defaulttrue

animation

DescriptionBy default ion-nav animates transition between pages based in the mode (ios or material design). However, this property allows to create custom transition using AnimationBuilder functions.
Attributeundefined
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined

root

DescriptionRoot NavComponent to load
Attributeroot
TypeFunction | HTMLElement | ViewController | null | string | undefined
Defaultundefined

rootParams

DescriptionAny parameters for the root component
Attributeundefined
Typeundefined | { [key: string]: any; }
Defaultundefined

swipeGesture

DescriptionIf the nav component should allow for swipe-to-go-back.
Attributeswipe-gesture
Typeboolean | undefined
Defaultundefined

イベント

NameDescription
ionNavDidChangeEvent fired when the nav has changed components
ionNavWillChangeEvent fired when the nav will change components

メソッド

canGoBack

DescriptionReturns true if the current view can go back.
SignaturecanGoBack(view?: ViewController | undefined) => Promise<boolean>

getActive

DescriptionGet the active view.
SignaturegetActive() => Promise<ViewController | undefined>

getByIndex

DescriptionGet the view at the specified index.
SignaturegetByIndex(index: number) => Promise<ViewController | undefined>

getPrevious

DescriptionGet the previous view.
SignaturegetPrevious(view?: ViewController | undefined) => Promise<ViewController | undefined>

insert

DescriptionInserts a component into the navigation stack at the specified index. This is useful to add a component at any point in the navigation stack.
Signatureinsert<T extends NavComponent>(insertIndex: number, component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

insertPages

DescriptionInserts an array of components into the navigation stack at the specified index. The last component in the array will become instantiated as a view, and animate in to become the active view.
SignatureinsertPages(insertIndex: number, insertComponents: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

pop

DescriptionPop a component off of the navigation stack. Navigates back from the current component.
Signaturepop(opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

popTo

DescriptionPop to a specific index in the navigation stack.
SignaturepopTo(indexOrViewCtrl: number | ViewController, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

popToRoot

DescriptionNavigate back to the root of the stack, no matter how far back that is.
SignaturepopToRoot(opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

push

DescriptionPush a new component onto the current navigation stack. Pass any additional information along as an object. This additional information is accessible through NavParams.
Signaturepush<T extends NavComponent>(component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

removeIndex

DescriptionRemoves a component from the navigation stack at the specified index.
SignatureremoveIndex(startIndex: number, removeCount?: number, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

setPages

DescriptionSet the views of the current navigation stack and navigate to the last view. By default animations are disabled, but they can be enabled by passing options to the navigation controller. Navigation parameters can also be passed to the individual pages in the array.
SignaturesetPages(views: NavComponent[] | NavComponentWithProps[], opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

setRoot

DescriptionSet the root for the current navigation stack to a component.
SignaturesetRoot<T extends NavComponent>(component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>

CSS Shadow Parts

No CSS shadow parts available for this component.

CSSカスタムプロパティ

No CSS custom properties available for this component.

Slots

No slots available for this component.

View Source