nathantsoi/vue-native-websocket

我重构了这个插件,让它可以在vue3上工作,欢迎各位感兴趣的开发者使用。

likaia opened this issue · 6 comments

reconnection: true可以实现真正的重连吗?

亲测可以

@likaia 作者的项目vue-native-websocket重连未生效,有遇到这种情况么?

Vue.use(VueNativeSock, 'ws://localhost:9090', {
reconnection: true, // (Boolean) whether to reconnect automatically (false)
reconnectionAttempts: 5, // (Number) number of reconnection attempts before giving up (Infinity),
reconnectionDelay: 3000, // (Number) how long to initially wait before attempting a new (1000)
})

client连接上server后,重启server , client 没有reconnect , 哪里没有配置好么?

你需要在vuex配置对应的函数,你可以看看我的开源项目的使用方法

你需要在vuex配置对应的函数,你可以看看我的开源项目的使用方法

可以了,谢谢你。这个项目使用vuex是必须的,不是可选配置项?

对,他这个必须配上vuex