Skip to content

Commit b59f1a4

Browse files
committed
readme changes
1 parent 63235b3 commit b59f1a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ vuex.mutationPrefix|String |`null`|Optional|Prefix for emitting server side vuex
5757

5858
#### 🌈 Component Level Usage
5959

60+
<p>if you want listen socket events from component side, you have to add `sockets` object in Vue component, and every function will start listen events, depends on object key</p>
61+
6062
``` javascript
6163
new Vue({
6264
sockets: {
@@ -68,9 +70,9 @@ new Vue({
6870
}
6971
},
7072
methods: {
71-
clickButton: function (val) {
73+
clickButton: function (data) {
7274
// $socket is socket.io-client instance
73-
this.$socket.emit('emit_method', val);
75+
this.$socket.emit('emit_method', data);
7476
}
7577
}
7678
})

0 commit comments

Comments
 (0)