mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
feat(ion-router): dynamic routes
This commit is contained in:
@ -49,6 +49,11 @@ string
|
||||
string
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
#### ionRouteDataChanged
|
||||
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
|
||||
@ -1,12 +1,25 @@
|
||||
import { Component, Prop } from '@stencil/core';
|
||||
|
||||
import { Component, Event, Prop } from '@stencil/core';
|
||||
import { EventEmitter } from 'ionicons/dist/types/stencil.core';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-route'
|
||||
})
|
||||
export class Route {
|
||||
|
||||
@Prop() url = '';
|
||||
@Prop() component: string;
|
||||
@Prop() redirectTo: string;
|
||||
@Prop() componentProps: {[key: string]: any};
|
||||
|
||||
@Event() ionRouteDataChanged: EventEmitter;
|
||||
|
||||
componentDidLoad() {
|
||||
this.ionRouteDataChanged.emit();
|
||||
}
|
||||
componentDidUnload() {
|
||||
this.ionRouteDataChanged.emit();
|
||||
}
|
||||
componentDidUpdate() {
|
||||
this.ionRouteDataChanged.emit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user