Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isSwitchTab 判断异常 #54

Open
CementSealing opened this issue Dec 16, 2022 · 7 comments
Open

isSwitchTab 判断异常 #54

CementSealing opened this issue Dec 16, 2022 · 7 comments

Comments

@CementSealing
Copy link

以前用得没什么问题,然后不知道怎么就报错了。报错主要是在登录页和redirect路由页面

图片

在文档中有说:在使用页面标签化的功能的时候注意 originalRoutes 需要处理得当,请问需要怎么注意处理得当,SwitchTabsLayout文件与DEMO的一样

@yunsii
Copy link
Owner

yunsii commented Dec 16, 2022

感谢反馈,下班后抽个时间看一下

@yunsii
Copy link
Owner

yunsii commented Dec 18, 2022

如果可以的话建议给个复现 demo 方便排查,抑或把 originalTabsRoutes 贴出来看看呢?

@CementSealing
Copy link
Author

图片

@yunsii
Copy link
Owner

yunsii commented Dec 19, 2022

我的意思是 console.log 一下报错时候的 originalTabsRoutes 😂

@CementSealing
Copy link
Author

location:

{
  "pathname": "/user/login",
  "search": "",
  "hash": "",
  "query": {},
  "key": "t714eu"
}

originalTabsRoutes:

  {
    "path": "/home-page",
    "name": "首页",
    "icon": {
      "type": {},
      "key": null,
      "ref": null,
      "props": {},
      "_owner": null,
      "_store": {}
    },
    "component": {},
    "exact": true,
    "unaccessible": false,
    "locale": "menu.home-page"
  },
  {
    "path": "https://pro.ant.design/docs/getting-started-cn",
    "name": "报表管理",
    "icon": {
      "type": {},
      "key": null,
      "ref": null,
      "props": {},
      "_owner": null,
      "_store": {}
    },
    "target": "_blank",
    "exact": true,
    "unaccessible": false,
    "locale": "menu.report-management"
  },
  {
    "path": "/index.html",
    "redirect": "/home-page",
    "exact": true,
    "unaccessible": false
  }
]```

好像当routes的path配置为url时会出现报错, 例如以上的 `"path": "https://pro.ant.design/docs/getting-started-cn",`

@yunsii
Copy link
Owner

yunsii commented Dec 19, 2022

那大概率是这个原因了,我回头看看

@yunsii
Copy link
Owner

yunsii commented Dec 20, 2022

@CementSealing 刚才突然想到,你可以暂时先把 routes 中的 https:// 开头的路由过滤掉试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants