在router文件夾下的index.js加入 需要添加的側邊欄內容 這個是靜態路由 不需要權限
如下 然後npm run dev 就跑起來了
{
path: '/products',
component: Layout,
hidden: true,
children: [
{
path: 'edit/:id',
name: 'Edit',
component: () => import('@/views/products/edit'),
meta: { title: '編輯商品', icon: 'form' }
}
]
},
{
path: '/form',
component: Layout,
children: [
{
path: 'index',
name: 'Form',
component: () => import('@/views/form/index'),
meta: { title: 'Form', icon: 'form' }
}
]
},
當然需要在views文件夾下添加products文件夾和index.vue