import { _decorator, Component, Label, Node } from 'cc';
import { event_item } from '../../data/data';
const { ccclass, property } = _decorator;

@ccclass('show_select_evele_list_item')
export class show_select_evele_list_item extends Component {
    @property(Node) lab_name:Node = null;
    private m_data:event_item = null;
    private m_call_back = null;
    public initView(data:event_item,call){
        this.m_data = data;
        this.m_call_back  = call;
        this.lab_name.getComponent(Label).string = `事件名:${this.m_data.event_name}-id：${ this.m_data.event_id.toString()}`
        this.node.on(Node.EventType.TOUCH_END,()=>{
            if( this.m_call_back!=null){
                this.m_call_back(this.getData())
            }
        })
    }

    public getData(){
        return this.m_data;
    }
}


