| 12345678910111213141516171819202122 |
- import { DatePipe } from '@angular/common';
- import { Component, ViewEncapsulation } from '@angular/core';
- @Component({
- standalone: true,
- selector: 'app-factory-overview',
- styleUrls: ['./factory-overview.css'],
- templateUrl: './factory-overview.component.html',
- encapsulation: ViewEncapsulation.None,
- imports: [DatePipe]
-
- })
- export class FactoryOverviewComponent {
- currentTime: Date = new Date();
- ngOnInit(): void {
- // 更新时间,每秒更新一次
- setInterval(() => {
- this.currentTime = new Date();
- }, 1000);
- }}
|