mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
create setRoot()
This commit is contained in:
@ -53,7 +53,7 @@ class MyApp {
|
|||||||
aside.close();
|
aside.close();
|
||||||
|
|
||||||
let nav = this.app.getComponent('myNav');
|
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);
|
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) {
|
transition(enteringItem, leavingItem, opts, callback) {
|
||||||
if (!enteringItem || enteringItem === leavingItem) {
|
if (!enteringItem || enteringItem === leavingItem) {
|
||||||
return callback();
|
return callback();
|
||||||
|
@ -157,9 +157,6 @@ export class ViewItem {
|
|||||||
setInstance(instance) {
|
setInstance(instance) {
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
this.instance._viewItem = this;
|
this.instance._viewItem = this;
|
||||||
|
|
||||||
this.instance._viewDidEnter = new EventEmitter('viewDidEnter');
|
|
||||||
this.instance._viewWillEnter = new EventEmitter('viewWillEnter');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
Reference in New Issue
Block a user