router.js 909 B

123456789101112131415161718192021222324252627282930313233
  1. export default ({app, store}) => {
  2. if (process.client) {
  3. app.router.options.routes.unshift({
  4. name: 'kaifainSeoDetails_$',
  5. path: '/s/:tid',
  6. component: () => import('@/pages/kaifain/detail/_tid/index.vue')
  7. })
  8. app.router.options.routes.unshift({
  9. name: 'kaifainCaseSeoDetails_$',
  10. path: '/d/:tid',
  11. component: () => import('@/pages/kaifain/case/_tid.vue')
  12. })
  13. app.router.matcher.addRoutes([{
  14. name: 'kaifainSeoDetails_$',
  15. path: '/s/:tid',
  16. component: () => import('@/pages/kaifain/detail/_tid/index.vue')
  17. }, {
  18. name: 'kaifainCaseSeoDetails_$',
  19. path: '/d/:tid',
  20. component: () => import('@/pages/kaifain/case/_tid.vue')
  21. }])
  22. console.log('router', app.router)
  23. }
  24. app.router.beforeEach((to, from, next)=> {
  25. if (process.client) {
  26. console.log("location.href", to, from)
  27. }
  28. next()
  29. })
  30. }