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


@Component({
  selector: 'app-articlethree',
  templateUrl: './articlethree.component.html',
  styleUrls: ['./articlethree.component.scss']
})
export class ArticlethreeComponent {


  comments = [
    { user: '阿平', avatar: '../../assets/images/passerby1.jpg', message: '哇塞' },
    { user: '明天在不在', avatar: '../../assets/images/passerby2.jpg', message: '啊啊啊啊啊啊啊啊啊啊啊' },
    { user: '无敌暴龙', avatar: '../../assets/images/passerby3.jpg', message: '在哪里？' }
  ];
  newComment: string = '';

  addComment() {
    if (this.newComment) {
      const newComment = {
        user: '我',
        avatar: '../../assets/images/slide1.jpg',
        message: this.newComment
      };
      this.comments.push(newComment);
      this.newComment = '';
    }
  }
}
