main.js 484 B

1234567891011121314151617181920212223
  1. import Vue from 'vue'
  2. import './plugins/vuetify'
  3. import App from './App.vue'
  4. import router from './router'
  5. import store from './store'
  6. import VueNativeSock from 'vue-native-websocket'
  7. Vue.config.productionTip = false
  8. Vue.use(VueNativeSock, 'ws://example.com', {
  9. store,
  10. connectManually: true,
  11. reconnection: true,
  12. reconnectionAttempts: 5,
  13. reconnectionDelay: 1000
  14. })
  15. store.$socket = Vue.prototype.$socket
  16. new Vue({
  17. router,
  18. store,
  19. render: h => h(App)
  20. }).$mount('#app')