一、描述
在@ant-design/pro-layout(6.3.0)的ProLayout中使用selectedKeys,报如下错误
Uncaught TypeError: (z || []).join is not a function
at BaseMenu.js:317
二、分析
1、想实现根据访问地址自动选中菜单项,尝试collapsed等参数均不能实现
2、使用selectedKeys={location.pathname}就会报如上错误,效果到是实现了。改成 selectedKeys={[location.pathname]}不报错了,但不生效
3、
四、参考文章
1、https://procomponents.ant.design/components/layout/#%E4%BB%8E%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%8E%B7%E5%8F%96
2、https://github.com/ant-design/ant-design-pro-layout/issues/580
3、
注意:本文归作者所有,未经作者允许,不得转载