我通过uni.createTCPSocket()创建socket,成功连接后,调用socket的write方法,但是报错
MiniProgramError
Cannot read properties of undefined (reading 'send')
TypeError: Cannot read properties of undefined (reading 'send')
at Proxy.write (WAServiceMainContext.js:1:1761044)
at Function.<anonymous> (app-service.js:1768:1799)
at <setTimeout callback function>
at (WASubContext.js:1:147853)
at Function.<anonymous> (WASubContext.js:1:110205)
at Function.<anonymous> (WASubContext.js:1:142742)
at p (WAServiceMainContext.js:1:151651)
at (WAServiceMainContext.js:1:152094)
at (WAServiceMainContext.js:1:139600)
at Timeout._onTimeout (<anonymous>:407:55767)
我直接使用wx.createTCPSocket()就不会有此问题
1 个回复
1***@qq.com (作者)
从vue3切换成vue2就没问题了。