导航路由格式

{
    path: '/', //路径名
    component: 'Layout', //组件名,一级路由默认使用Lauout 一级导航
    redirect: 'index',//重定向
    children: [//子路由,用于定义二级导航
      {
        path: 'index',
        name: 'Index',//路由名称,注意首字母要大写
        component: 'index/index',
        meta: {//定义导航栏信息
          title: '首页', //导航标题
          icon: 'home', //图标名称
          affix: true, //
        },
      },
    ],
  },










  {
    path: '/mamager',
    component: 'Layout',
    redirect: 'noRedirect',
    meta: { title: '网吧管理'remixIcon: 'airplay-line' },
    children: [
      {
        path: 'mamagerList',
        name: 'MamagerList',
        component: 'cybercafeManager/managerList/index',
        meta: { title: '网吧管理'remixIcon: 'airplay-line' },
      },
    ],
  },
  {
    path: '/safeCenter',
    component: 'Layout',
    redirect: 'noRedirect',
    meta: { title: '安全中心'icon: 'shield-alt' },
    children: [
      {
        path: 'ruleList',
        name: 'RuleList',
        component: 'safeCenter/ruleList/index',
        meta: {
          title: '规则列表',
          icon: 'layer-group',
        },
      },
      {
        path: '/payServe',
        name: 'payServe',
        component: 'safeCenter/payServe/index',
        meta: {
          title: '购买服务',
          icon: 'layer-group',
        },
      },
    ],
  },
  {
    path: '/userCenter',
    component: 'Layout',
    redirect: 'noRedirect',
    meta: { title: '用户中心'icon: 'user' },
    children: [
      {
        path: 'userInfo',
        name: 'UserInfo',
        component: 'userCenter/userInfo/index',
        meta: {
          title: '账号信息',
          remixIcon: 'bar-chart-horizontal-line',
        },
      },
      {
        path: 'moneyManager',
        name: 'MoneyManager',
        component: 'userCenter/moneyManager/index',
        meta: {
          title: '财务管理',
          remixIcon: 'bar-chart-horizontal-line',
        },
      },
      {
        path: 'myOrder',
        name: 'MyOrder',
        component: 'userCenter/myOrder/index',
        meta: {
          title: '我的订单',
          remixIcon: 'bar-chart-horizontal-line',
        },
      },
    ],
  },
  {
    path: '/handleCenter',
    component: 'Layout',
    redirect: 'noRedirect',
    children: [
      {
        path: 'handleCenter',
        name: 'HandleCenter',
        component: 'handleCenter/index',
        meta: {
          title: '操作中心',
          icon: 'cog',
        },
      },
    ],
  },
  {
    path: '/test',
    component: 'Layout',
    redirect: 'noRedirect',
    children: [
      {
        path: 'test',
        name: 'Test',
        component: 'test/index',
        meta: {
          title: 'test',
          icon: 'marker',
          permissions: ['admin''test'],
        },
      },
    ],

  }
}

参数说明:


    //当设置 true 的时候该路由不会再侧边栏出现

hidden: true; // (默认 false)


//当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
redirect: "noRedirect";


//是否显示根节点
alwaysShow: true;
//设定路由的名字,首字母大写,一定要填写不然使用<keep-alive>时会出现各种问题


name: "Test";
meta: {
//设置该路由进入的权限,支持多个权限叠加


permissions: ["admin", "editor", "test"];
//设置该路由在侧边栏和面包屑中展示的名字


title: "title";
//设置该路由的图标,在常规图标中拷贝即可


icon: "";
//设置该路由的图标,在小清新图标中拷贝即可,但小清新图标的svg默认未集成到项目需要手动下载并拷贝到根目remixIcon/svg文件夹下


remixIcon: "";
//如果设置为true,则不会被 <keep-alive> 缓存(默认 false)


noKeepAlive: true;
breadcrumb: false; // 如果设置为false,则不会在breadcrumb面包屑中显示