mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Add basic Vue 3 compatibility (#289)
This commit is contained in:
parent
2f63eebb70
commit
3337d43298
2 changed files with 16 additions and 6 deletions
10
dist/vue-socketio.js
vendored
10
dist/vue-socketio.js
vendored
File diff suppressed because one or more lines are too long
|
@ -28,8 +28,16 @@ export default class VueSocketIO {
|
||||||
*/
|
*/
|
||||||
install(Vue){
|
install(Vue){
|
||||||
|
|
||||||
|
const version = Number(Vue.version.split('.')[0])
|
||||||
|
|
||||||
|
if (version >= 3) {
|
||||||
|
Vue.config.globalProperties.$socket = this.io;
|
||||||
|
Vue.config.globalProperties.$vueSocketIo = this;
|
||||||
|
} else {
|
||||||
Vue.prototype.$socket = this.io;
|
Vue.prototype.$socket = this.io;
|
||||||
Vue.prototype.$vueSocketIo = this;
|
Vue.prototype.$vueSocketIo = this;
|
||||||
|
}
|
||||||
|
|
||||||
Vue.mixin(Mixin);
|
Vue.mixin(Mixin);
|
||||||
|
|
||||||
Logger.info('Vue-Socket.io plugin enabled');
|
Logger.info('Vue-Socket.io plugin enabled');
|
||||||
|
|
Loading…
Add table
Reference in a new issue