~~~ import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-header', templateUrl: './header.component.html', styleUrls: ['./header.component.css'] }) export class HeaderComponent implements OnInit { public obj:object={ title:"obj title" } public title:string='标题'; constructor() { } ngOnInit(): void { } } ~~~