websoket配置如下:
//main.ts
import VueNativeSock from 'vue-native-websocket-vue3'
import * as types from './store/mutation-types/socket'
import App from './App.vue'
const muconst app = createApp(App)
tations = {
0: types.SOCKET_ONOPEN,
1: types.SOCKET_ONCLOSE,
2: types.SOCKET_ONERROR,
3: types.SOCKET_ONMESSAGE,
4: types.SOCKET_RECONNECT,
5: types.SOCKET_RECONNECT_ERROR
}
app.use(VueNativeSock,url, {
store,
mutations,
reconnection: true,
connectManually: true,
reconnectionDelay: 5000
})
不知道你这个问题是否已经解决, 如果还没有解决的话: