vue引入websocket
process.env.VUE_APP_WS_URL是vue3中开发环境中的websocket地址
核心代码
data() {
return {
// 重试定时器
wsIn: null,
// websocket
ws: null,
id: null
};
},
mounted() {
this.webSockectInitMessage(
process.env.VUE_APP_WS_URL + '/websocket/' + this.id
.
原创
2021-03-22 18:32:04 ·
814 阅读 ·
0 评论