main.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import store from '@/store'
  4. import { pcRouter } from '@/router'
  5. import { Loading } from 'element-ui'
  6. import Invite from '@/components/popup/invite'
  7. import Avatar from '@/components/popup/avatar'
  8. import Info from '@/components/popup/userInfo'
  9. import otherInfo from '@/components/popup/otherInfo'
  10. import imgPreview from '@/components/popup/imgPreview'
  11. import packetGet from '@/components/popup/packetGet'
  12. import packetSend from '@/components/popup/packetSend'
  13. import pswSetting from '@/components/popup/pswSetting'
  14. import Toast from '@/components/popup/toast'
  15. import groupTypeSetting from '@/components/popup/groupTypeSetting'
  16. import VueClipboard from 'vue-clipboard2'
  17. import i18n from '@/util/lang/lang'
  18. // 全局自定义插件
  19. import '@/plugins/directive'
  20. // 引用公共模块
  21. import '../common'
  22. Vue.use(Invite, store, pcRouter)
  23. Vue.use(Avatar, store, i18n)
  24. Vue.use(Info, store, i18n)
  25. Vue.use(otherInfo, store, pcRouter)
  26. Vue.use(packetGet, store)
  27. Vue.use(packetSend, store)
  28. Vue.use(pswSetting, store)
  29. Vue.use(Toast)
  30. Vue.use(groupTypeSetting, store)
  31. Vue.use(VueClipboard)
  32. Vue.use(imgPreview)
  33. Vue.use(Loading)
  34. Vue.config.productionTip = false
  35. new Vue({
  36. render: h => h(App),
  37. store,
  38. i18n,
  39. router: pcRouter
  40. }).$mount('#app')
  41. if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
  42. location.replace('/h5.html' + location.search + location.hash)
  43. }