mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-06-25 13:20:34 +03:00
Make manually connection configurable
This commit is contained in:
@@ -8,6 +8,7 @@ export default {
|
||||
|
||||
let observer = null
|
||||
|
||||
if (opts.connectManually) {
|
||||
Vue.prototype.$connect = function () {
|
||||
observer = new Observer(connection, opts)
|
||||
Vue.prototype.$socket = observer.WebSocket
|
||||
@@ -18,6 +19,10 @@ export default {
|
||||
Vue.prototype.$socket.close()
|
||||
delete Vue.prototype.$socket
|
||||
}
|
||||
} else {
|
||||
observer = new Observer(connection, opts)
|
||||
Vue.prototype.$socket = observer.WebSockekt
|
||||
}
|
||||
|
||||
Vue.mixin({
|
||||
created () {
|
||||
|
||||
Reference in New Issue
Block a user