From e84ac8ce717b36c937889b472aa3cb03b1366973 Mon Sep 17 00:00:00 2001 From: David Vezzani Date: Mon, 15 Jan 2018 08:49:31 -0700 Subject: [PATCH] corrects published documentation Yes, the code actually needs to be fixed, but in the mean time, for those new to this project, this correction will get you running. See https://github.com/MetinSeylan/Vue-Socket.io/issues/85#issuecomment-328351693 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 009af80..22617d2 100755 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Vue.use(VueSocketio, socketio('http://socketserver.com:1923'), store); #### On Vuejs instance usage ``` js +import Vue from 'vue' + var vm = new Vue({ sockets:{ connect: function(){ @@ -47,7 +49,7 @@ var vm = new Vue({ methods: { clickButton: function(val){ // $socket is socket.io-client instance - this.$socket.emit('emit_method', val); + (new Vue()).$socket.emit('emit_method', val); } } })