mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(router-outlet): css and change logic
This commit is contained in:
@ -154,15 +154,16 @@ sub {
|
||||
// --------------------------------------------------
|
||||
|
||||
ion-app,
|
||||
ion-router-outlet,
|
||||
ion-tab,
|
||||
ion-tabs,
|
||||
ion-nav,
|
||||
.ion-page {
|
||||
@include position(0);
|
||||
|
||||
position: absolute;
|
||||
z-index: $z-index-page-container;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -170,6 +171,14 @@ ion-app,
|
||||
contain: layout size style;
|
||||
}
|
||||
|
||||
ion-app,
|
||||
.ion-page {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.hide-page {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
@import "../../themes/util";
|
||||
|
||||
ion-nav {
|
||||
@include position(0);
|
||||
|
||||
position: absolute;
|
||||
z-index: $z-index-page-container;
|
||||
overflow: hidden;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
contain: layout size style;
|
||||
}
|
||||
@ -22,7 +22,6 @@ import mdTransitionAnimation from './animations/md.transition';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-nav',
|
||||
styleUrl: 'nav.scss'
|
||||
})
|
||||
export class NavControllerBase implements NavOutlet {
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ export class RouterOutlet implements NavOutlet {
|
||||
|
||||
private isTransitioning = false;
|
||||
private activeEl: HTMLElement = undefined;
|
||||
private activeComponent: any;
|
||||
|
||||
mode: string;
|
||||
|
||||
@ -28,14 +29,16 @@ export class RouterOutlet implements NavOutlet {
|
||||
@Prop() delegate: FrameworkDelegate;
|
||||
|
||||
componentDidUnload() {
|
||||
this.activeEl = undefined;
|
||||
this.activeEl = this.activeComponent = undefined;
|
||||
}
|
||||
|
||||
@Method()
|
||||
async setRoot(component: HTMLElement|string, params?: {[key: string]: any}, opts?: RouterOutletOptions): Promise<boolean> {
|
||||
if (this.isTransitioning) {
|
||||
if (this.isTransitioning || this.activeComponent === component) {
|
||||
return false;
|
||||
}
|
||||
this.activeComponent = component;
|
||||
|
||||
// attach entering view to DOM
|
||||
const enteringEl = await attachComponent(this.delegate, this.el, component, ['ion-page', 'hide-page'], params);
|
||||
const leavingEl = this.activeEl;
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
@import "../../themes/ionic.globals";
|
||||
|
||||
ion-tab {
|
||||
@include position(0, null, null, 0);
|
||||
|
||||
position: absolute;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
import { Build, Component, Element, Event, EventEmitter, Method, Prop, State, Watch } from '@stencil/core';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-tab',
|
||||
styleUrl: 'tab.scss'
|
||||
tag: 'ion-tab'
|
||||
})
|
||||
export class Tab {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user