From a3a8c23b196980732a795713a5eb5fe0c7075bf9 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 11 Jul 2018 21:47:13 +0800 Subject: [PATCH] Revert "提交" --- src/app/routes/pro/list/list/list.component.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/src/app/routes/pro/list/list/list.component.ts b/src/app/routes/pro/list/list/list.component.ts new file mode 100644 index 0000000..1745cd0 --- /dev/null +++ b/src/app/routes/pro/list/list/list.component.ts @@ -0,0 +1,43 @@ +import { Component, ViewChild, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { PageHeaderComponent } from '@delon/abc'; + +@Component({ + // tslint:disable-next-line:component-selector + selector: 'pro-list-layout', + templateUrl: './list.component.html', +}) +export class ProListLayoutComponent implements OnInit { + tabs: any[] = [ + { + key: 'articles', + tab: '������', + }, + { + key: 'applications', + tab: '������', + }, + { + key: 'projects', + tab: '������', + }, + ]; + + @ViewChild('ph') ph: PageHeaderComponent; + + pos = 0; + + constructor(private router: Router) {} + + ngOnInit(): void { + const key = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); + const idx = this.tabs.findIndex(w => w.key === key); + if (idx !== -1) this.pos = idx; + } + + to(item: any) { + this.router + .navigateByUrl(`/pro/list/${item.key}`) + .then(() => this.ph.refresh()); + } +} -- Gitblit v1.8.0