

import { Component } from '@angular/core';

@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss']
})
export class Tab2Page {

  showComment: boolean = false;
  newComment: string = '';

  constructor() {}
  
  showCommentBox() {
    this.showComment = !this.showComment;
  }

  addComment() {
    // 添加评论的逻辑
  }

  toggleIconColor(event: { target: any; }) {
    const icon = event.target;
    if (icon.getAttribute('color') === 'danger') {
      icon.setAttribute('color', 'primary');
    } else {
      icon.setAttribute('color', 'danger');
    }
  }
}



