import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';

@Component({
  selector: 'app-only-image',
  templateUrl: './app-only-image.component.html',
  styleUrls: ['./app-only-image.component.scss'],
})
export class AppOnlyImage implements OnInit {

  public _messages:Array<any> =[];

  @Input() public title:string;

  /**
   *  输入数组
   */
  @Input() set items(val:any){
    if(val){
      this._messages = JSON.parse(JSON.stringify(val));
    }
  }

        /**
   * 抛出数据
   */
  @Output() menuClick:EventEmitter<any> =new EventEmitter<any>();

  constructor() { }

  ngOnInit() {}

  handleClick(item:any){
    this.menuClick.emit(item);
  }

}
