cc.Class({ extends: cc.Component, properties: { closeBtn: { default: null, type: cc.Node } }, // LIFE-CYCLE CALLBACKS: onLoad () { let self = this; this.closeBtn.on('click', function () { self.node.removeFromParent(true); }) }, start () { }, // update (dt) {}, });