vue-element-admin new page

If you are familiar  vue-router configuration is very simple.

First,  @/router/index.js increase the route you need to add in.

Such as: excel add a page

{
  path: '/excel',
  component: Layout, redirect: '/excel/export-excel', name: 'excel', meta: { title: 'excel', icon: 'excel' } } 

TIP

Only this way will not have any effect, it just creates a based on layouta route, you need below it  children add the sub route.

{
  path: '/excel',
  component: Layout, redirect: '/excel/export-excel', name: 'excel', meta: { title: 'excel', icon: 'excel' }, children: [ { path: 'export-excel', component: ()=>import('excel/exportExcel'), name: 'exportExcel', meta: { title: 'exportExcel' } } ] } 

Such sidebar will appear as shown in  menu-item the

 

TIP

Since the  children following only specifies a route they will not have to expand the arrow, if childrenthe number is greater than 1 the following route will have to expand the arrow, as shown below. If you want to ignore this automatic judgment can be used  alwaysShow: true, so that it will ignore the rules defined before, always show the root route. For details, see Routing and sidebar

{
  path: '/excel',
  component: Layout, redirect: '/excel/export-excel', name: 'excel', meta: { title: 'excel', icon: 'excel' }, children: [ { path: 'export-excel', component: ()=>import('excel/exportExcel'), name: 'exportExcel', meta: { title: 'exportExcel' }}, { path: 'export-selected-excel', component: ()=>import('excel/selectExcel'), name: 'selectExcel', meta: { title: 'selectExcel' }}, { path: 'upload-excel', component: ()=>import('excel/uploadExcel'), name: 'uploadExcel', meta: { title: 'uploadExcel' }} ] } 

Sidebar will appear as shown in  submenu the

 

http://www.vapsint.cn
http://www.moshii.cn
http://www.shamandaweiyu.cn
http://www.taiguangyinlou.cn
http://www.dexidunn.cn
http://www.marbooo.cn
http://www.hiago.cn
http://www.fioan.cn
http://www.yumengse.cn
http://www.yajuxuan.cn
http://www.eternelle.cn

Guess you like

Origin www.cnblogs.com/zjhcap/p/11520601.html