cc.Class({ extends: cc.Component, properties: { bgFrames: [cc.SpriteFrame], titleRichText: cc.RichText, tabText: '好友排行' }, // LIFE-CYCLE CALLBACKS: // onLoad () {}, start () { }, init () { }, show () { this.getComponent(cc.Button).interactable = false; this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[1]; this.titleRichText.string = `${this.tabText}`; }, hide () { this.getComponent(cc.Button).interactable = true; this.getComponent('cc.Sprite').spriteFrame = this.bgFrames[0]; this.titleRichText.string = `${this.tabText}`; } // update (dt) {}, });