ProLayout会出现undefined is not iterable (cannot read property Symbol(Symbol.iterator))
📷 复现步骤
hash路由模式下,直接更改路由地址复现
💻 复现代码
import { PageContainer, ProLayout } from "@ant-design/pro-components";
import { Space } from "antd";
import { FC, } from "react";
import { Outlet, } from "react-router-dom";
import { DownloadOutlined, UserOutlined } from "@ant-design/icons";
import logo from "@assets/logo.png";
import { useLocation,useMatches } from "react-router-dom";
import { getMenuData } from "@router/index";
🐛 bug 描述
ProLayout会出现undefined is not iterable (cannot read property Symbol(Symbol.iterator))
📷 复现步骤
hash路由模式下,直接更改路由地址复现
💻 复现代码
import { PageContainer, ProLayout } from "@ant-design/pro-components"; import { Space } from "antd"; import { FC, } from "react"; import { Outlet, } from "react-router-dom"; import { DownloadOutlined, UserOutlined } from "@ant-design/icons"; import logo from "@assets/logo.png"; import { useLocation,useMatches } from "react-router-dom"; import { getMenuData } from "@router/index";
const Layout: FC = () => { const menuData=getMenuData(); const location=useLocation(); const matches=useMatches(); const breadcrumb=matches.filter(({handle}:any)=>!!handle?.breadcrumb).map(({handle,pathname}:any)=>({path:"/#"+pathname,title:handle.breadcrumb}));
return (
); };
export default Layout;
© 版本信息
🚑 其他信息