export default class Test extends cc.Component{
//#region 声明
public foo():void;
public foo(a:string,b:string):string;
public foo(a:number,b:number):number;
//#endregion
//实现
public foo(a?:string|number,b?:string|number):any{
return null;
}
}
TypeScript 函数重载
最新推荐文章于 2024-07-04 23:50:09 发布