美文网首页
2020-04-19 如何创建vue路由的懒加载

2020-04-19 如何创建vue路由的懒加载

作者: Rascar | 来源:发表于2020-04-19 20:47 被阅读0次
    //懒加载
    const login = () => import('../views/login/login')//登录页面
    const Home = ()=>import('../views/Home/home')
    const index = () => import('../views/index/index')
    const TargetList = () => import('../views/TargetList/TargetList.vue')//提现信息
    
    
    
    //路由
    const routes = [
      {
        path: '/',
        redirect: 'login',
      },
      {
        path: '/login',
        name: 'login',
        component: login,
      },
      {
        path: '/index',
        name: 'index',
        component: index,
        children: [
          {
            path: '/orderManager' ,
            name : 'orderManager',
            component :orderManager
          },
    ]
    }
    ]

    相关文章

      网友评论

          本文标题:2020-04-19 如何创建vue路由的懒加载

          本文链接:https://www.haomeiwen.com/subject/oxsibhtx.html