routes.js 979 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Home from '@/pages/Home'
  2. export default [
  3. {
  4. name: 'home',
  5. path: '/',
  6. component: Home
  7. },
  8. {
  9. name: 'biblio',
  10. path: '/biblio',
  11. components: {
  12. default: () => import(/* webpackChunkName: "texts" */ '@/pages/Biblio'),
  13. options: () => import(/* webpackChunkName: "texts" */ '@/pages/_partials/TextOptions')
  14. },
  15. props: {
  16. default: ({ query }) => ({
  17. mode: query.mode || 'tree-map',
  18. // In case of a reload or direct link, vue-router doesn't turn the query string into an array.
  19. texts: query.texts && query.texts.length && typeof query.texts[0] === 'string'
  20. ? query.texts.map(text => text.split(',').map(id => parseInt(id)))
  21. : query.texts
  22. }),
  23. options: ({ query }) => ({
  24. show: !('texts' in query)
  25. })
  26. }
  27. },
  28. {
  29. name: 'notfound',
  30. path: '/404',
  31. alias: '*',
  32. component: () => import(/* webpackChunkName: "404" */ '@/pages/NotFound.vue')
  33. }
  34. ]