从"Blog"仓库中分离出来
This commit is contained in:
28
index/src/app/components/header/header.component.ts
Normal file
28
index/src/app/components/header/header.component.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {UserService} from '../../services/user/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-header',
|
||||
templateUrl: './header.component.html',
|
||||
styleUrls: ['./header.component.css']
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
|
||||
constructor(public userService: UserService) {
|
||||
}
|
||||
|
||||
// 菜单是否可见
|
||||
public visible: boolean = false;
|
||||
// 导航是否可见(手机显示时)
|
||||
public visibleOfMenu: boolean = false;
|
||||
|
||||
ngOnInit() {
|
||||
this.userService.getUserInfo();
|
||||
this.userService.http.visit();
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.userService.logout();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user