Files
cocos4/cocos2d/core/components/CCComponentEventHandler.js
T
2016-01-27 14:22:47 +08:00

40 lines
851 B
JavaScript

/**
* Component will register a event to target component's handler.
* And it will trigger the handler when a certain event occurs.
*
* @class Component.EventHandler
*/
cc.Component.EventHandler = cc.Class({
name: 'cc.CompEventHandler',
properties: {
/**
* Event target
* @property target
* @type cc.Node
* @default null
*/
target: {
default: null,
type: cc.Node,
},
/**
* Component name
* @property component
* @type {String}
* @default ''
*/
component: {
default: '',
},
/**
* Event handler
* @property handler
* @type {String}
* @default ''
*/
handler: {
default: '',
}
}
});