码迷,mamicode.com
首页 > 其他好文 > 详细

03.简单的路由配置

时间:2019-05-22 19:28:44      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:out   one   exp   简单   history   use   const   route   login   

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‘
})

03.简单的路由配置

标签:out   one   exp   简单   history   use   const   route   login   

原文地址:https://www.cnblogs.com/tiandd/p/10907831.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!