超详细--vue3中使用socket.io-client + nodejs使用socket.io 实现实时通信
Vue中第一步:安装插件//注意:客户端和服务端版本一定要兼容,尽量一样//我的nodejs和vue中都是4.5.4版本npmisocket.io-client-S第二步:组件中引入使用发送import{io}from"socket.io-client";constsocket=io('http://localhost:6789',{autoConnect:true,//自动连接})constha