zoukankan      html  css  js  c++  java
  • 编程日志 Vue-element-admin

    新增页面,动态添加路由不成功,

    accessedTreeRoutes.push({
                path: element.url,
                component: Layout,
                children: [
                  {
                    path: 'index',
                    component: () => import(`@/views${element.component}/index`),
                    name: element.name,
                    meta: { title: element.name, icon: element.icon, noCache: true }
                  }
                ]
              })
     
              router.addRoutes(accessRoutes)
     
    编译会不成功
    .eslintrc.js
    要改
    'indent': "off",
        // 'indent': [2, 2, {
        //   'SwitchCase': 1
        // }],
        //'template-curly-spacing':  [2, 'never'],
    动态加载路由搞定。
  • 相关阅读:
    jar包和war包的区别:
    tail
    redis
    查看Linux操作系统版本
    CentOS 7.0 systemd代替service
    周刊(三月最后一期)
    周刊第四期
    周刊第三期
    周刊第二期
    周刊(第一期)
  • 原文地址:https://www.cnblogs.com/forhell/p/12331760.html
Copyright © 2011-2022 走看看