3.3.8 socket.on(eventName,callback)
socket.on('news',(data)=>{
console.log(data)
})
// 多个参数
socket.on('new',(arg1,arg2,arg3,arg4)=>{
// ...
})
// 使用回调
socket.on('news',(cb)=>{
cb(0)
})Last updated
Was this helpful?
socket.on('news',(data)=>{
console.log(data)
})
// 多个参数
socket.on('new',(arg1,arg2,arg3,arg4)=>{
// ...
})
// 使用回调
socket.on('news',(cb)=>{
cb(0)
})Last updated
Was this helpful?
Was this helpful?