mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
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
This commit is contained in:
parent
8951667903
commit
e84ac8ce71
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue