const {ccclass, property} = cc._decorator; @ccclass export default class SpecialTipsView extends cc.Component { @property(cc.Node) contentStr: cc.Node = null; callBack = null onLoad () { } start () { } initView(contentStr, callBack=null){ this.callBack = callBack this.contentStr.getComponent(cc.Label).string = contentStr } onClose(){ if(this.callBack){ this.callBack() } this.node.removeFromParent() this.node.destroy() } }