doc(router-outlet): the outlet can be used without any framework (#24664)

This commit is contained in:
Victor Berchet
2022-02-14 07:12:37 -08:00
committed by GitHub
parent 38627ff277
commit 82c41510de
2 changed files with 3 additions and 6 deletions

View File

@ -1,12 +1,9 @@
# 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.
> 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).
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.
Although router outlet has methods for navigating around, it's recommended to use the navigation methods in your framework's router.
## Life Cycle Hooks
Routes rendered in a Router Outlet have access to specific Ionic events that are wired up to animations

View File

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