mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Update README.MD
- Add example of connecting using socket.io-client instance
This commit is contained in:
parent
1796309fdc
commit
3fb67d42bc
1 changed files with 29 additions and 1 deletions
30
README.md
30
README.md
|
@ -27,7 +27,7 @@ are you looking for old documentation? <a href="https://github.com/MetinSeylan/V
|
||||||
``` bash
|
``` bash
|
||||||
npm install vue-socket.io --save
|
npm install vue-socket.io --save
|
||||||
```
|
```
|
||||||
|
##### Using Connection String
|
||||||
``` javascript
|
``` javascript
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
@ -51,6 +51,34 @@ new Vue({
|
||||||
}).$mount('#app')
|
}).$mount('#app')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Using socket.io-client Instance
|
||||||
|
``` javascript
|
||||||
|
import Vue from 'vue'
|
||||||
|
import store from './store'
|
||||||
|
import App from './App.vue'
|
||||||
|
import VueSocketIO from 'vue-socket.io'
|
||||||
|
|
||||||
|
Vue.use(
|
||||||
|
new VueSocketIO({
|
||||||
|
debug: true,
|
||||||
|
connection: SocketIO('http://metinseylan.com:1992', {
|
||||||
|
path: '/my-app/'
|
||||||
|
}),
|
||||||
|
vuex: {
|
||||||
|
store,
|
||||||
|
actionPrefix: "SOCKET_",
|
||||||
|
mutationPrefix: "SOCKET_"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
store,
|
||||||
|
render: h => h(App)
|
||||||
|
}).$mount('#app')
|
||||||
|
```
|
||||||
|
|
||||||
**Parameters**|**Type's**|**Default**|**Required**|**Description**
|
**Parameters**|**Type's**|**Default**|**Required**|**Description**
|
||||||
-----|-----|-----|-----|-----
|
-----|-----|-----|-----|-----
|
||||||
debug|Boolean|`false`|Optional|Enable logging for debug
|
debug|Boolean|`false`|Optional|Enable logging for debug
|
||||||
|
|
Loading…
Add table
Reference in a new issue