export default {
name: 'Panel',
vueSocket: {
onopen() {},
onmessage(msg) {
console.log(msg)
},
}
}
可以实现类似效果吗?https://github.com/MetinSeylan/Vue-Socket.io#-component-level-usage
export default {
name: 'Panel',
vueSocket: {
onopen() {},
onmessage(msg) {
console.log(msg)
},
}
}
可以实现类似效果吗?https://github.com/MetinSeylan/Vue-Socket.io#-component-level-usage
写一下自己的解决方法作为参考吧!
vm.$emit('subscribeMessage', list)
this.$root.$on('subscribeMessage', this.messagesHandler)
需求是什么?socket.io 自动调用?那你放在
methods
里一样的。