|
|
|
@ -28,17 +28,18 @@ export default class VueSocketIO {
|
|
|
|
|
*/
|
|
|
|
|
install(Vue){
|
|
|
|
|
|
|
|
|
|
const version = Number(Vue.version.split('.')[0])
|
|
|
|
|
const version = Number(Vue.version.split('.')[0]);
|
|
|
|
|
|
|
|
|
|
if (version >= 3) {
|
|
|
|
|
Vue.config.globalProperties.$socket = this.io;
|
|
|
|
|
Vue.config.globalProperties.$vueSocketIo = this;
|
|
|
|
|
Vue.mixin(Mixin(true));
|
|
|
|
|
} else {
|
|
|
|
|
Vue.prototype.$socket = this.io;
|
|
|
|
|
Vue.prototype.$vueSocketIo = this;
|
|
|
|
|
Vue.mixin(Mixin(false));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Vue.mixin(Mixin);
|
|
|
|
|
|
|
|
|
|
Logger.info('Vue-Socket.io plugin enabled');
|
|
|
|
|
|
|
|
|
|