You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
261 B
12 lines
261 B
export abstract class _Base {
|
|
static instance
|
|
|
|
static getInstance<T>(): T {
|
|
if (!this.instance) {
|
|
// 如果实例不存在,则创建一个新的实例
|
|
// @ts-ignore ...
|
|
this.instance = new this()
|
|
}
|
|
return this.instance
|
|
}
|
|
}
|
|
|