connect() {
this.socket = new WebSocket(this.url + ":" + this.port);
this.socket.binaryType = "arraybuffer";
this.socket.onopen = this.onOpen.bind(this);
this.socket.onmessage = this.onMessage.bind(this);
this.socket.onclose = this.onClose.bind(this);
this.socket.onerror = this.onError.bind(this);
}
onOpen(event) {
console.error(event); //event is undefined
}
你好,能否提供个可复现问题的简单代码片段?(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。