账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    深度遍历循环去掉单引号外面的双引号应该怎么做,小白求指教?
    41
    0
    {
      "errCode": "00000000",
      "errMsg": "SUCCESS",
      "timestamp": "1559127780939",
      "transId": "",
      "body": {
        "router": [
          {
            "path": "''",
            "component": "Layout",
            "redirect": "'/home'",
            "meta": {
              "title": "title",
              "icon": "icon"
            },
            "children": [
              {
                "path": "path",
                "name": "name",
                "component": "() => import('@/views/home/index')",
                "meta": {
                  "title": "title",
                  "icon": "icon"
                }
              },
              {
                "path": "path",
                "name": "name",
                "component": "() => import('@/views/home/index')",
                "meta": {
                  "title": "title",
                  "icon": "icon"
                }
              }
            ]
          },
          {
            "path": "''",
            "component": "Layout",
            "redirect": "'/home'",
            "meta": {
              "title": "title",
              "icon": "icon"
            },
            "children": [
              {
                "path": "path",
                "name": "name",
                "component": "() => import('@/views/home/index')",
                "meta": {
                  "title": "title",
                  "icon": "icon"
                }
              },
              {
                "path": "path",
                "name": "name",
                "component": "() => import('@/views/home/index')",
                "meta": {
                  "title": "title",
                  "icon": "icon"
                }
              }
            ]
          }
        ]
      }
    }

    如path:"''" ,component:"() => import('@/views/home/index')"以及redirect:"'/home'",去掉最外层双引号,这个需要怎么去遍历循环呢

    过滤成以下格式:

    {
          path: '',
          component: Layout,
          redirect: '/home',
          children: [{
            path: 'home',
            name: 'Home',
            component: () => import('@/views/home/index'),
            meta: {title: '首页', icon: 'home', headerText: '首页',   }
          }]
        }
    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部