let instacne = null;
export default class A{
static getInstance(){
if(!instacne){
instacne = new A();
}
return instacne;
}
}
使用:
let a = A.getInstance()
let instacne = null;
export default class A{
static getInstance(){
if(!instacne){
instacne = new A();
}
return instacne;
}
}
使用:
let a = A.getInstance()