1 const routes = [
 2   {
 3     path: '/',
 4     component: App,
 5     children: [
 6       {path: '/index/:type', name: 'index', component: Index},
 7       {path: '/home', name: 'home', component: Home},
 8       {path: '/HomeUserInfo/:uid', name: 'homeUserInfo', component: HomeUserInfo},
 9       {path: '/article/:id', name: 'article', component: Article},
10       {path: '/addmsg', name: 'addMsg', component: AddMsg},
11       {path: '/search/:types', name: 'searchresult', component: SearchResult},
12       {path: '/login', name: 'login', component: Login},
13       {path: '/register', name: 'register', component: Register},
14       {path: '/modif', name: 'Modifi', component: Modifi},
15       {path: '/admin', name: 'Admin', component: Admin}
16     ]
17   }
18 ]
19 const router = new VueRouter({
20   routes: routes, // short for routes: routes
21   linkActiveClass: 'active',  // router-link的选中状态的class,也有一个默认的值
22   history: true
23 })

 

相关文章:

  • 2021-07-29
  • 2021-06-29
  • 2021-10-05
  • 2021-06-16
  • 2019-07-03
  • 2021-06-29
猜你喜欢
  • 2021-08-03
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2018-06-21
相关资源
相似解决方案