import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; interface Person { id: string; name: string; integrity: number; organization: string; level: string; nature:string; time:string; addr:string; state:string } @Component({ selector: 'app-unit', templateUrl: './unit.component.html', styleUrls: ['./unit.component.scss'] }) export class UnitComponent implements OnInit { listOfData: Person[] = [ { id: '1', name: 'John Brown', integrity: 32, organization: 'New York No. 1 Lake Park', level:'重点单位', nature:'会议中心', time:'time', addr:'单位地址', state:'' } // { // id: '2', // name: 'Jim Green', // integrity: 42, // organization: 'London No. 1 Lake Park' // }, // { // id: '3', // name: 'Joe Black', // integrity: 32, // organization: 'Sidney No. 1 Lake Park' // } ]; constructor(private router: Router) { } ngOnInit(): void { } searchValue = ''; next() { this.router.navigate(['/basicInfo/unit/details']); } ngOnDestroy(): void { console.log('删除了6666666666666') // CustomReuseStrategy.deleteRouteSnapshot('/basicInfo/unit'); } }