03.简单的路由配置

Vue.use(Router)
const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/index',
    name: 'index',
    component: Index,
    children: [
    {
      path: '/hello',
      name: 'hello',
      component: HelloWorld
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      component: About
    },
 
   ]
  },
  {// 重定向
    path: '/',
    redirect: '/login'
  }
  ];
export default new Router({
  routes,
  mode: 'history'
})

猜你喜欢

转载自www.cnblogs.com/tiandd/p/10907831.html
03.