cocoscreator 2.2.2 学习笔记-单例
实现基类模板
export default class Singleton<T>{
private static instance: any = null;
public static Instance<T>(c: { new(): T }): T {
if (this.instance == null) {
this.instance = new c();
...
原创
2020-09-15 14:50:33 ·
201 阅读 ·
0 评论