import { _decorator, Component, Label, Node } from 'cc'; import { config } from '../../config'; const { ccclass, property } = _decorator; @ccclass('add_task_item') export class add_task_item extends Component { @property(Node) lab_name:Node = null; private call_back = null; private m_type:number = 0; public initView(type:number,call){ this.call_back = call; this.m_type = type; this.lab_name.getComponent(Label).string = config.task_type_map.get(type) this.node.on(Node.EventType.TOUCH_END,()=>{ if(this.call_back!=null){ this.call_back(this.m_type) } }) } }