路由

封装了页面路由,使客户端和服务器复用相同的路由配置。

src/router/index.js文件下配置路由

export default store => {
  return new Router({
    mode: 'history',
    scrollBehavior(to, from, savedPosition) {
        return { x: 0, y: 0 }
    },
    routes: [
      {
            path: '/login',
            component: () => import('@/pages/login/index'),
            hidden: true
        },
      {
          path: '/404',
          component: () => import('@/pages/404'),
          hidden: true
      },
        {
            path: '/',
            component: Layout,
            redirect: '/home',
            children: [
                {
                    path: 'home',
                    name: 'home',
                    component: () => import('@/pages/home/index'),
                    meta: { title: 'home', icon: 'home' }
                }
            ]
        }
    ]
}
Copyright ©大数据项目组 2019 all right reserved,powered by Gitbook本文档更新于: 2019-11-25 02:41

results matching ""

    No results matching ""