ion-route
Ionic4项目中我们可以使用Ionic4路由组件ion-route对项目进行布局。 ion-route官方文档地址:https://ionicframework.com/docs/api/routeRouter is a component that can take a component, and render it when the Browser URl matches the url prop
Note: this is only meant for vanilla JavaScript project. For Angular projects, use
ion-router-outlet
and the Angular router.
ion-route 属性(Properties)
component | |
---|---|
Description | Name of the component to load/select in the navigation outlet ( The value of this property is not always the tagname of the component to load,
in |
Attribute | component |
Type | string |
componentProps | |
Description | A key value |
Type | undefined | { [key: string]: any; } |
url | |
Description | Relative path that needs to match in order for this route to apply. Accepts paths similar to expressjs so that you can define parameters in the url /foo/:bar where bar would be available in incoming props. |
Attribute | url |
Type | string |
Default | '' |
ion-route 事件(Events)
Name | Description |
---|---|
ionRouteDataChanged | Used internally by `ion-router` to know when this route did change. |