import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import {Location} from '@angular/common';//这个要写
@Component({
selector: 'app-flash',
templateUrl: './flash.component.html',
styleUrls: ['./flash.component.css']
})
export class FlashComponent implements OnInit {
//这个要写
constructor(public router:Router,public location:Location) { }
ngOnInit() {
//这个要写
this.location.replaceState('/main');
setTimeout(()=>{this.router.navigateByUrl('/main')}, 3000);
}
jumpNow(){
this.router.navigateByUrl('/main')
}
}
angular浏览器不能点击返回
最新推荐文章于 2022-07-22 16:56:46 发布