vue-路由配置-管理系统

页面逻辑:首先要进入登录页面,登录成功后进入首页,首页部分有功能菜单,功能菜单有一级菜单或者二级菜单

功能菜单部分的截图:

vue-路由配置-管理系统

路由设置:

//layout是布局组件,左侧是导航菜单,右顶部是面包屑,右底部是路由出口,所以每进入一个页面首先加载布局组件;
const routes = [{
        path: "/login",
        component: Login
    },
    // 重定向到login
    {
        path: '/',
        redirect: '/login'
    },

    // 首页(一级菜单)
    {
        path: '/home',
        component: Layout,
        children: [{
            path: '',
            component: () =>
                import ('@/views/home/Home.vue')
        }]
    },
    // 店铺管理(一级菜单)
    {
        path: '/shops',
        component: Layout,
        children: [{
            path: '',
            component: () =>
                import ('@/views/shops/Shops.vue')
        }]
    },
    // 商品管理(二级菜单)childrem的哈希值可以省略/
    {
        path: '/goods',
        component: Layout,
        children: [{
                path: 'goodslist',
                component: () =>
                    import ('@/views/goods/GoodsList.vue')
            },
            {
                path: 'goodsadd',
                component: () =>
                    import ('@/views/goods/GoodsAdd.vue')
            },
            {
                path: 'goodstype',
                component: () =>
                    import ('@/views/goods/GoodsType.vue')
            },
        ]
    },
]

 

上一篇:input radio点击选中再点击取消


下一篇:用JQuery实现选中select里面的option显示对应的div