ts 单例模式
ts 单例模式
class AudioManage { static audio: AudioManage|null = null constructor(){ console.log("constructor") } static Instance(){ // Audio.audio = new Audio() if(AudioManage.audio == null){ AudioManage.audio = new AudioManage(); } return AudioManage.audio } } let audio = AudioManage.Instance()