mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Update readme for vue 3 installation
This commit is contained in:
parent
a062b3f46f
commit
c6b6f3e342
2 changed files with 30 additions and 4 deletions
26
README.md
26
README.md
|
@ -57,6 +57,7 @@ new Vue({
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Using socket.io-client Instance
|
##### Using socket.io-client Instance
|
||||||
|
###### For vue 2
|
||||||
``` javascript
|
``` javascript
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
|
@ -84,6 +85,31 @@ new Vue({
|
||||||
}).$mount('#app')
|
}).$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**
|
**Parameters**|**Type's**|**Default**|**Required**|**Description**
|
||||||
-----|-----|-----|-----|-----
|
-----|-----|-----|-----|-----
|
||||||
debug|Boolean|`false`|Optional|Enable logging for debug
|
debug|Boolean|`false`|Optional|Enable logging for debug
|
||||||
|
|
8
dist/vue-socketio.js
vendored
8
dist/vue-socketio.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue