ant-design-pro-plus
ant-design-pro-plus copied to clipboard
isSwitchTab 判断异常
以前用得没什么问题,然后不知道怎么就报错了。报错主要是在登录页和redirect路由页面
在文档中有说:在使用页面标签化的功能的时候注意 originalRoutes 需要处理得当
,请问需要怎么注意处理得当,SwitchTabsLayout文件与DEMO的一样
感谢反馈,下班后抽个时间看一下
如果可以的话建议给个复现 demo 方便排查,抑或把 originalTabsRoutes 贴出来看看呢?
我的意思是 console.log 一下报错时候的 originalTabsRoutes 😂
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",`
那大概率是这个原因了,我回头看看
@CementSealing 刚才突然想到,你可以暂时先把 routes 中的 https:// 开头的路由过滤掉试试