Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. /**
  2. * THIS FILE IS GENERATED AUTOMATICALLY.
  3. * DO NOT EDIT.
  4. *
  5. * You are probably looking on adding startup/initialization code.
  6. * Use "quasar new boot <name>" and add it there.
  7. * One boot file per concern. Then reference the file(s) in quasar.conf.js > boot:
  8. * boot: ['file', ...] // do not add ".js" extension to it.
  9. *
  10. * Boot files are your "main.js"
  11. **/
  12.  
  13.  
  14.  
  15. import '@quasar/extras/roboto-font/roboto-font.css'
  16.  
  17. import '@quasar/extras/material-icons/material-icons.css'
  18.  
  19.  
  20.  
  21.  
  22. // We load Quasar stylesheet file
  23. import 'quasar/dist/quasar.sass'
  24.  
  25.  
  26.  
  27.  
  28. import 'src/css/app.css'
  29.  
  30.  
  31. import Vue from 'vue'
  32. import createApp from './app.js'
  33.  
  34.  
  35.  
  36.  
  37. import qboot_Bootaxios from 'boot/axios'
  38.  
  39.  
  40.  
  41. import { addPreFetchHooks } from './client-prefetch.js'
  42.  
  43.  
  44.  
  45.  
  46.  
  47. Vue.config.devtools = true
  48. Vue.config.productionTip = false
  49.  
  50.  
  51.  
  52. console.info('[Quasar] Running SPA.')
  53.  
  54.  
  55.  
  56.  
  57.  
  58. async function start () {
  59. const { app, store, router } = await createApp()
  60.  
  61.  
  62.  
  63.  
  64. let routeUnchanged = true
  65. const redirect = url => {
  66. routeUnchanged = false
  67. window.location.href = url
  68. }
  69.  
  70. const urlPath = window.location.href.replace(window.location.origin, '')
  71. const bootFiles = [qboot_Bootaxios]
  72.  
  73. for (let i = 0; routeUnchanged === true && i < bootFiles.length; i++) {
  74. if (typeof bootFiles[i] !== 'function') {
  75. continue
  76. }
  77.  
  78. try {
  79. await bootFiles[i]({
  80. app,
  81. router,
  82. store,
  83. Vue,
  84. ssrContext: null,
  85. redirect,
  86. urlPath
  87. })
  88. }
  89. catch (err) {
  90. if (err && err.url) {
  91. window.location.href = err.url
  92. return
  93. }
  94.  
  95. console.error('[Quasar] boot error:', err)
  96. return
  97. }
  98. }
  99.  
  100. if (routeUnchanged === false) {
  101. return
  102. }
  103.  
  104.  
  105.  
  106.  
  107.  
  108. addPreFetchHooks(router, store)
  109.  
  110.  
  111.  
  112.  
  113. new Vue(app)
  114.  
  115.  
  116.  
  117.  
  118.  
  119. }
  120.  
  121. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement