Update readme for vue 3 installation

pull/306/head
Sebastien Hernoux 4 years ago
parent a062b3f46f
commit c6b6f3e342

@ -57,6 +57,7 @@ new Vue({
```
##### Using socket.io-client Instance
###### For vue 2
``` javascript
import Vue from 'vue'
import store from './store'
@ -84,6 +85,31 @@ new Vue({
}).$mount('#app')
```
###### For vue 3
``` javascript
import Vue from 'vue'
import store from './store'
import App from './App.vue'
import VueSocketIO from 'vue-socket.io'
import SocketIO from 'socket.io-client'
const vueSocket = new VueSocketIO({
debug: true,
connection: SocketIO('http://metinseylan.com:1992', options), //options object is Optional
vuex: {
store,
actionPrefix: "SOCKET_",
mutationPrefix: "SOCKET_"
}
});
createApp(App)
.use(store)
.use(router)
.use(vueSocket)
.mount('#app');
```
**Parameters**|**Type's**|**Default**|**Required**|**Description**
-----|-----|-----|-----|-----
debug|Boolean|`false`|Optional|Enable logging for debug

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save