https://cli.angular.io/


 

打开终端创建header组件:

ng g component components/header
import { Component, OnInit } from '@angular/core'; /*引入 angular 核心*/

@Component({
  selector: 'app-header', /*使用这个组件的名称*/
  templateUrl: './header.component.html', /*html 模板*/
  styleUrls: ['./header.component.scss'] /*css 样式*/
})
export class HeaderComponent implements OnInit { /*实现接口*/

  constructor() { }/*构造函数*/

  ngOnInit() {/*初始化加载的生命周期函数*/
  }

}

 

 

相关文章:

  • 2022-12-23
  • 2018-06-04
  • 2021-09-17
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-07
  • 2022-03-07
  • 2021-04-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案