import VueRouter from "vue-router";

const routes=[
    {
        path:'/login',
        name:'login',
        component: () => import('../components/Login')
    },
    {
        path:'/',
        name:'login',
        component: () => import('../components/Login')
    },
    {
        path:'/index',
        name:'index',
        component: () => import('../components/Index'),
        children:[
            {
                path:'/home',
                name:'home',
                meta:{
                    title:'首页'
                },
                component: () => import('../components/Login')
            },
            {
                path:'/Zhengliqingdan',
                name:'Zhengliqingdan',
                meta:{
                    title:'整理完成未上架清单'
                },
                component: () => import('@/components/duochaxun/Zhengliqingdan.vue')
            },
            {
                path:'/Rukuzhengli',
                name:'Rukuzhengli',
                meta:{
                    title:'入库整理'
                },
                component: () => import('@/components/duochaxun/Rukuzhengli.vue')
            },
            {
                path:'/Kucunhuizong',
                name:'Kucunhuizong',
                meta:{
                    title:'库存汇总界面'
                },
                component: () => import('@/components/duochaxun/Kucunhuizong.vue')
            },
            {
                path:'/Jianhuojiemian',
                name:'Jianhuojiemian',
                meta:{
                    title:'拣货界面'
                },
                component: () => import('@/components/duochaxun/Jianhuojiemian.vue')
            },
            {
                path:'/Kucunrizhi',
                name:'Kucunrizhi',
                meta:{
                    title:'库存操作日志'
                },
                component: () => import('@/components/duochaxun/Kucunrizhi.vue')
            },
            {
                path:'/Liaoxiangjiankong',
                name:'Liaoxiangjiankong',
                meta:{
                    title:''
                },
                component: () => import('@/components/duochaxun/Liaoxiangjiankong.vue')
            },

        ]
    }
]

const route=new VueRouter({
    mode:'history',
    routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
    return VueRouterPush.call(this, to).catch(err => err)
}

export default route;
