Commit e214a495 authored by frank's avatar frank 🏀

显示添加<ion-router-outlet></ion-router-outlet>

parent c8e268cc
...@@ -50,5 +50,5 @@ ...@@ -50,5 +50,5 @@
<!--</ion-tab-button>--> <!--</ion-tab-button>-->
</ion-tab-bar> </ion-tab-bar>
</ion-tabs> </ion-tabs>
<ion-router-outlet></ion-router-outlet> <ion-router-outlet name="details"></ion-router-outlet>
</ion-content> </ion-content>
...@@ -196,18 +196,7 @@ export class EnvHomePage implements OnInit { ...@@ -196,18 +196,7 @@ export class EnvHomePage implements OnInit {
slideDidChange() { slideDidChange() {
// this.slide.startAutoplay(); // this.slide.startAutoplay();
this.lunbo = {
speed: 1000,
allowTouchMove: true,
effect: 'flip',
autoplay: {
delay: 2000,
},
loop: true,
spaceBetween: 0,
zoom: false,
height: 150,
};
} }
toggleFocus(a){ toggleFocus(a){
......
...@@ -28,25 +28,25 @@ const routes: Routes = [ ...@@ -28,25 +28,25 @@ const routes: Routes = [
children: [ children: [
{ {
path: 'tab-home', path: 'tab-home',
component: EnvHomePage component: EnvHomePage,
}, },
{ {
path: 'tab-anal', path: 'tab-anal',
component: EnvAnalPage component: EnvAnalPage,
}, },
{ {
path: 'tab-alarm', path: 'tab-alarm',
component: EnvAlarmPage component: EnvAlarmPage,
}, },
{ {
path: 'tab-cfg', path: 'tab-cfg',
component: EnvCfgPage component: EnvCfgPage,
}, },
{ {
path: '', path: '',
redirectTo: 'tab-home', redirectTo: 'tab-home',
}, },
] ],
}, },
]; ];
......
<ion-router-outlet></ion-router-outlet> <router-outlet name='tabs' (activate)='onActivate($event)'></router-outlet>
<ion-tabs> <ion-tabs>
<ion-tab-bar slot="bottom"> <ion-tab-bar slot="bottom">
......
import { Component, OnInit } from '@angular/core'; import {Component, ComponentFactoryResolver, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, ActivationStart, Router, RouterOutlet} from '@angular/router';
@Component({ @Component({
selector: 'v-tabs', selector: 'v-tabs',
...@@ -7,9 +8,19 @@ import { Component, OnInit } from '@angular/core'; ...@@ -7,9 +8,19 @@ import { Component, OnInit } from '@angular/core';
}) })
export class TabsPage implements OnInit { export class TabsPage implements OnInit {
constructor() { } @ViewChild(RouterOutlet) outlet: RouterOutlet;
constructor(private router: Router) {
}
ngOnInit() { ngOnInit() {
this.router.events.subscribe(e => {
if (e instanceof ActivationStart && e.snapshot.outlet === "administration")
console.log('DDEDEDEEEEEEEEEDDDDDDDDDDDDDDDDD');
this.outlet.deactivate();
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment