2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-06-17 21:20:34 +03:00

support websocket protocol, this is optional option.

This commit is contained in:
Aaron Chen
2017-06-29 15:31:50 +08:00
parent fd5d4a6a59
commit 93e17ffe0f
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -3,10 +3,10 @@ import Emitter from './Emitter'
export default {
install (Vue, connection, store, opts = {}) {
install (Vue, connection, protocol = '', store, opts = {}) {
if (!connection) { throw new Error('[vue-native-socket] cannot locate connection') }
let observer = new Observer(connection, store, opts)
let observer = new Observer(connection, store, protocol, opts)
Vue.prototype.$socket = observer.WebSocket