mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
create setRoot()
This commit is contained in:
@ -53,7 +53,7 @@ class MyApp {
|
||||
aside.close();
|
||||
|
||||
let nav = this.app.getComponent('myNav');
|
||||
nav.setItems([component.component]);
|
||||
nav.setRoot(component.component);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,6 +177,13 @@ export class ViewController extends Ion {
|
||||
return this.push(component.component || component, component.params, opts);
|
||||
}
|
||||
|
||||
setRoot(ComponentType, params = {}, opts = {}) {
|
||||
return this.setItems([{
|
||||
component: ComponentType,
|
||||
params: params
|
||||
}], opts);
|
||||
}
|
||||
|
||||
transition(enteringItem, leavingItem, opts, callback) {
|
||||
if (!enteringItem || enteringItem === leavingItem) {
|
||||
return callback();
|
||||
|
@ -157,9 +157,6 @@ export class ViewItem {
|
||||
setInstance(instance) {
|
||||
this.instance = instance;
|
||||
this.instance._viewItem = this;
|
||||
|
||||
this.instance._viewDidEnter = new EventEmitter('viewDidEnter');
|
||||
this.instance._viewWillEnter = new EventEmitter('viewWillEnter');
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
Reference in New Issue
Block a user