From b59f1a4a60a39f95ca7b5279f710065f6a0c37df Mon Sep 17 00:00:00 2001 From: Metin Seylan Date: Sun, 18 Nov 2018 15:17:16 +0300 Subject: [PATCH] readme changes --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51e7b09..05959da 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ vuex.mutationPrefix|String |`null`|Optional|Prefix for emitting server side vuex #### 🌈 Component Level Usage +

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

+ ``` javascript new Vue({ sockets: { @@ -68,9 +70,9 @@ new Vue({ } }, methods: { - clickButton: function (val) { + clickButton: function (data) { // $socket is socket.io-client instance - this.$socket.emit('emit_method', val); + this.$socket.emit('emit_method', data); } } })