若依直接在router文件里配置的,没有在若依的菜单管理里配
然后也出现了上面链接里的那个中出现头部、左侧菜单和面包屑的情况
完整代码
{path: '/zichan',meta: { title: '零星资产处置审批', icon: 'dashboard', affix: true, noCache: true },component: Layout,// redirect: 'noredirect',hidden: false,breadcrumb: false,children: [{path: '/stock',meta: { title: '存货模块', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'index',hidden: false,children: [{path: '/cutting',meta: { title: '打切件', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'index',hidden: false,children: [{path: '/cutting/cutting1',component: () => import('@/views/project/stock/cutting/cutting1/cutting1'),name: 'cutting1',meta: { title: '打切件1', icon: 'user,', affix: true, breadcrumb: false, noCache: true }},{path: '/cutting/cutting2',component: () => import('@/views/project/stock/cutting/cutting2/cutting2'),name: 'cutting2',meta: { title: '打切件2', icon: 'user', affix: true, breadcrumb: false, noCache: true }}]},{path: '/ItemInStock',meta: { title: '在库件', icon: 'dashboard', affix: true, noCache: true },// component: Layout,// redirect: 'index',hidden: false,},{path: '/equipment',meta: { title: '资材', icon: 'dashboard', affix: true, noCache: true },// component: Layout,// redirect: 'index',hidden: false,}]},{path: '/lingxing',meta: { title: '零星资产模块', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,children: [{path: '/NotAccount',meta: { title: '不在账', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,children: [{path: '/qingdanList',component: () => import('@/views/project/qingdanList/index'),name: 'qingdanList',meta: { title: '清单查询', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},{path: '/qingdanDetail',component: () => import('@/views/project/qingdanDetail/index'),name: 'qingdanDetail',meta: { title: '零星资产', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},{path: '/waste',component: () => import('@/views/project/waste/index'),name: 'waste',meta: { title: '有价废弃物', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},{path: '/property',component: () => import('@/views/project/property/index'),name: 'property',meta: { title: '资产', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},{path: '/jiaojieList',component: () => import('@/views/project/jiaojieList/index'),name: 'JiaojieList',meta: { title: '预处置资产清单', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},{path: '/jiaojieList1',component: () => import('@/views/project/jiaojieList1/index'),name: 'JiaojieList1',meta: { title: '月资产处置明细', icon: 'dashboard', affix: true, breadcrumb: false, noCache: true }},]},{path: '/cutter',meta: { title: '刀具', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,},{path: '/GrindingTool',meta: { title: '磨具', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,}]},{path: '/GeneralValuable',meta: { title: '一般有价废弃物模块', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,children: [{path: '/Referenced',meta: { title: '引在制系统', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,},{path: '/Citation',meta: { title: '引日报系统', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,},{path: '/Market',meta: { title: '市场不良报废件', icon: 'dashboard', affix: true, noCache: true },component: ParentView,// redirect: 'noredirect',hidden: false,},]}]},
效果
关键代码
//一级菜单
import Layout from '@/layout'
//二级,三级菜单
import ParentView from '@/components/ParentView'
//除了一级路由要写component: Layout,后面二,三级豆写component: ParentView,
假如只配置一级,直接写这个即可