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

@ccclass('select_ui_top_type_item')
export class select_ui_top_type_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.top_view_type_map.get(this.m_type)
        this.node.on(Node.EventType.TOUCH_END,()=>{
            if(this.call_back!=null){
                this.call_back(this.m_type)
            }
        })
    }
}


