如何写精华回答,获更多曝光?
发布
export class Test {
static readonly KEY: string = 'key';
static KEY1: string = 'key';
static log() {
}
}
/**
* ============分割线============
*/
export class Test1 {
readonly KEY: string = 'KEY'
KEY1: string = 'KEY1'
log() {
}
}
export default new Test1()
/**
* ============分割线============
*/
export class Test2 {
private static instance: Test2;
private constructor() {
}
public static getInstance(): Test2 {
if (!Test2.instance) {
Test2.instance = new Test2();
}
return Test2.instance;
}
readonly KEY: string = 'KEY'
KEY1: string = 'KEY1'
log() {
}
}