mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-06-23 09:20:34 +03:00
Readme update for manual connect
`vm.$connect(connectionURL, connectionOpts)` example in the `Readme`
This commit is contained in:
@@ -69,8 +69,8 @@ Vue.use(VueNativeSock, 'ws://localhost:9090', {
|
|||||||
const vm = new Vue()
|
const vm = new Vue()
|
||||||
// Connect to the websocket target specified in the configuration
|
// Connect to the websocket target specified in the configuration
|
||||||
vm.$connect()
|
vm.$connect()
|
||||||
// Connect to an alternative websocket URI
|
// Connect to an alternative websocket URL and Options e.g.
|
||||||
vm.$connect('ws://localhost:9090/alternative/connection/')
|
vm.$connect('ws://localhost:9090/alternative/connection/', { format: 'json' })
|
||||||
// do stuff with WebSockets
|
// do stuff with WebSockets
|
||||||
vm.$disconnect()
|
vm.$disconnect()
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user