router.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import { normalizeURL, decode } from 'ufo'
  4. import { interopDefault } from './utils'
  5. import scrollBehavior from './router.scrollBehavior.js'
  6. const _294a513f = () => interopDefault(import('..\\pages\\association\\index.vue' /* webpackChunkName: "pages/association/index" */))
  7. const _110b9b8e = () => interopDefault(import('..\\pages\\classic\\index.vue' /* webpackChunkName: "pages/classic/index" */))
  8. const _683e67b2 = () => interopDefault(import('..\\pages\\editor\\index.vue' /* webpackChunkName: "pages/editor/index" */))
  9. const _6407bd6c = () => interopDefault(import('..\\pages\\joinus\\index.vue' /* webpackChunkName: "pages/joinus/index" */))
  10. const _0819c62c = () => interopDefault(import('..\\pages\\word\\index.vue' /* webpackChunkName: "pages/word/index" */))
  11. const _062accae = () => interopDefault(import('..\\pages\\info\\_id.vue' /* webpackChunkName: "pages/info/_id" */))
  12. const _05c20866 = () => interopDefault(import('..\\pages\\searchInfo\\_id.vue' /* webpackChunkName: "pages/searchInfo/_id" */))
  13. const _6fc9a934 = () => interopDefault(import('..\\pages\\index.vue' /* webpackChunkName: "pages/index" */))
  14. const emptyFn = () => {}
  15. Vue.use(Router)
  16. export const routerOptions = {
  17. mode: 'history',
  18. base: '/',
  19. linkActiveClass: 'nuxt-link-active',
  20. linkExactActiveClass: 'nuxt-link-exact-active',
  21. scrollBehavior,
  22. routes: [{
  23. path: "/association",
  24. component: _294a513f,
  25. name: "association"
  26. }, {
  27. path: "/classic",
  28. component: _110b9b8e,
  29. name: "classic"
  30. }, {
  31. path: "/editor",
  32. component: _683e67b2,
  33. name: "editor"
  34. }, {
  35. path: "/joinus",
  36. component: _6407bd6c,
  37. name: "joinus"
  38. }, {
  39. path: "/word",
  40. component: _0819c62c,
  41. name: "word"
  42. }, {
  43. path: "/info/:id?",
  44. component: _062accae,
  45. name: "info-id"
  46. }, {
  47. path: "/searchInfo/:id?",
  48. component: _05c20866,
  49. name: "searchInfo-id"
  50. }, {
  51. path: "/",
  52. component: _6fc9a934,
  53. name: "index"
  54. }],
  55. fallback: false
  56. }
  57. export function createRouter (ssrContext, config) {
  58. const base = (config._app && config._app.basePath) || routerOptions.base
  59. const router = new Router({ ...routerOptions, base })
  60. // TODO: remove in Nuxt 3
  61. const originalPush = router.push
  62. router.push = function push (location, onComplete = emptyFn, onAbort) {
  63. return originalPush.call(this, location, onComplete, onAbort)
  64. }
  65. const resolve = router.resolve.bind(router)
  66. router.resolve = (to, current, append) => {
  67. if (typeof to === 'string') {
  68. to = normalizeURL(to)
  69. }
  70. return resolve(to, current, append)
  71. }
  72. return router
  73. }