|
|
@@ -1,5 +1,6 @@
|
|
|
import { Component, Input } from '@angular/core';
|
|
|
import { IonicModule } from '@ionic/angular';
|
|
|
+import { Output, EventEmitter } from '@angular/core';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-task-card',
|
|
|
@@ -9,9 +10,17 @@ import { IonicModule } from '@ionic/angular';
|
|
|
imports: [IonicModule]
|
|
|
})
|
|
|
export class TaskCardComponent {
|
|
|
+ @Input() id: string = '';
|
|
|
@Input() title = '';
|
|
|
@Input() tags: string[] = [];
|
|
|
@Input() dueDate = '';
|
|
|
@Input() dueTime = '';
|
|
|
@Input() subtasksCount = 0;
|
|
|
+
|
|
|
+// 导入 Output 和 EventEmitter
|
|
|
+@Output() cardClick = new EventEmitter<string>();
|
|
|
+
|
|
|
+ onClick() {
|
|
|
+ this.cardClick.emit(this.id);
|
|
|
+ }
|
|
|
}
|