0👍
If you’re using vue-router you can do the following:
{
path: '/BB',
name: 'BB',
component: BB,
beforeEnter (to, from, next) {
if (!Vue.prototype.$socket) {
Vue.use(VueSocketio, WS_URL)
}
next()
}
}
Source: How to disabled vue-socket.io in some vue-router component
Source:stackexchange.com