Browse Source

测试match

xinfeng 5 years ago
parent
commit
f39f8f81a6
1 changed files with 13 additions and 4 deletions
  1. 13 4
      plugins/router.js

+ 13 - 4
plugins/router.js

@@ -4,16 +4,25 @@ export default ({app, store}) => {
     
     switch (urlType) {
       case 'kaifain': {
-        app.router.options.routes.unshift({
+        // app.router.options.routes.unshift({
+        //   name: 'kaifainSeoDetails_$',
+        //   path: '/s/:tid',
+        //   component: () => import('@/pages/kaifain/detail/_tid/index.vue')
+        // })
+        // app.router.options.routes.unshift({
+        //   name: 'kaifainCaseSeoDetails_$',
+        //   path: '/d/:tid',
+        //   component: () => import('@/pages/kaifain/case/_tid.vue')
+        // })
+        app.router.matcher.addRoutes([{
           name: 'kaifainSeoDetails_$',
           path: '/s/:tid',
           component: () => import('@/pages/kaifain/detail/_tid/index.vue')
-        })
-        app.router.options.routes.unshift({
+        }, {
           name: 'kaifainCaseSeoDetails_$',
           path: '/d/:tid',
           component: () => import('@/pages/kaifain/case/_tid.vue')
-        })
+        }])
         break;
       }
     }