mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
doc(router-outlet): the outlet can be used without any framework (#24664)
This commit is contained in:
@ -1,12 +1,9 @@
|
|||||||
# ion-router-outlet
|
# ion-router-outlet
|
||||||
|
|
||||||
Router outlet is a component used in routing within an Angular, React, or Vue app. It behaves in a similar way to Angular's built-in router outlet component and Vue's router view component, but contains the logic for providing a stacked navigation, and animating views in and out.
|
The router outlet behaves in a similar way to Angular's built-in router outlet component and Vue's router view component, but contains the logic for providing a stacked navigation, and animating views in and out.
|
||||||
|
|
||||||
> Note: this component should only be used with Angular, React, and Vue projects. For vanilla or Stencil JavaScript projects, use [`ion-router`](../router) and [`ion-route`](../route).
|
|
||||||
|
|
||||||
Although router outlet has methods for navigating around, it's recommended to use the navigation methods in your framework's router.
|
Although router outlet has methods for navigating around, it's recommended to use the navigation methods in your framework's router.
|
||||||
|
|
||||||
|
|
||||||
## Life Cycle Hooks
|
## Life Cycle Hooks
|
||||||
|
|
||||||
Routes rendered in a Router Outlet have access to specific Ionic events that are wired up to animations
|
Routes rendered in a Router Outlet have access to specific Ionic events that are wired up to animations
|
||||||
|
|||||||
@ -7,9 +7,9 @@ The router is a component for handling routing inside vanilla and Stencil JavaSc
|
|||||||
Apps should have a single `ion-router` component in the codebase.
|
Apps should have a single `ion-router` component in the codebase.
|
||||||
This component controls all interactions with the browser history and it aggregates updates through an event system.
|
This component controls all interactions with the browser history and it aggregates updates through an event system.
|
||||||
|
|
||||||
`ion-router` is just a URL coordinator for the navigation outlets of ionic: `ion-nav` and `ion-tabs`.
|
`ion-router` is just a URL coordinator for the navigation outlets of ionic: `ion-nav`, `ion-tabs`, and `ion-router-outlet`.
|
||||||
|
|
||||||
That means the `ion-router` never touches the DOM, it does NOT show the components or emit any kind of lifecycle events, it just tells `ion-nav` and `ion-tabs` what and when to "show" based on the browser's URL.
|
That means the `ion-router` never touches the DOM, it does NOT show the components or emit any kind of lifecycle events, it just tells `ion-nav`, `ion-tabs`, and `ion-router-outlet` what and when to "show" based on the browser's URL.
|
||||||
|
|
||||||
In order to configure this relationship between components (to load/select) and URLs, `ion-router` uses a declarative syntax using JSX/HTML to define a tree of routes.
|
In order to configure this relationship between components (to load/select) and URLs, `ion-router` uses a declarative syntax using JSX/HTML to define a tree of routes.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user