mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-06-03 18:49:23 +08:00
优化
This commit is contained in:
@@ -54,7 +54,7 @@ export class LayerNotify extends Node {
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示toast
|
||||
* 渐隐飘过提示
|
||||
* @param content 文本表示
|
||||
* @param useI18n 是否使用多语言
|
||||
*/
|
||||
|
||||
@@ -74,8 +74,10 @@ export class CommonPrompt extends Component {
|
||||
}
|
||||
|
||||
private setBtnCancelLabel() {
|
||||
this.lab_cancel!.dataID = this.config.cancelWord;
|
||||
this.lab_cancel!.node!.parent!.active = this.config.needCancel || false;
|
||||
if (this.lab_cancel) {
|
||||
this.lab_cancel.dataID = this.config.cancelWord;
|
||||
this.lab_cancel.node.parent!.active = this.config.needCancel || false;
|
||||
}
|
||||
}
|
||||
|
||||
private onOk() {
|
||||
|
||||
@@ -234,7 +234,8 @@ export class GameComponent extends Component {
|
||||
*/
|
||||
protected setButton(...args: string[]) {
|
||||
this.node.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
|
||||
var func = this[event.target.name];
|
||||
var self: any = this;
|
||||
var func = self[event.target.name];
|
||||
if (func)
|
||||
func(event);
|
||||
else
|
||||
@@ -251,10 +252,11 @@ export class GameComponent extends Component {
|
||||
* onGlobal(event: string, args: any) { console.log(args) };
|
||||
*/
|
||||
protected setEvent(...args: string[]) {
|
||||
var self: any = this;
|
||||
for (const name of args) {
|
||||
var func = this[name];
|
||||
var func = self[name];
|
||||
if (func)
|
||||
this.on(name, this[name], this);
|
||||
this.on(name, self[name], this);
|
||||
else
|
||||
console.error(`名为【${name}】的全局事方法不存在`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user