feat: 删除路由拦截器,添加二级路由
This commit is contained in:
@@ -1,14 +1,57 @@
|
||||
/** @format */
|
||||
|
||||
import DefaultLayOut from "@/layout/default";
|
||||
import { useEffect } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { GithubFilled, InfoCircleFilled, QuestionCircleFilled } from "@ant-design/icons";
|
||||
import { PageContainer, ProCard, ProLayout } from "@ant-design/pro-components";
|
||||
import { useState } from "react";
|
||||
import defaultProps from "./_defaultProps";
|
||||
import { Link, Outlet } from "react-router-dom";
|
||||
|
||||
export default () => {
|
||||
const [pathname, setPathname] = useState("/mainRouter/homeRouter");
|
||||
|
||||
export default observer(() => {
|
||||
useEffect(() => {}, []);
|
||||
return (
|
||||
<>
|
||||
<DefaultLayOut />
|
||||
</>
|
||||
<div
|
||||
id="test-pro-layout"
|
||||
style={{
|
||||
height: "100vh",
|
||||
}}>
|
||||
<ProLayout
|
||||
siderWidth={216}
|
||||
menuItemRender={(menuItemProps, defaultDom) => {
|
||||
if (menuItemProps.isUrl || !menuItemProps.path) {
|
||||
return defaultDom;
|
||||
}
|
||||
return <Link to={menuItemProps.path}>{defaultDom}</Link>;
|
||||
}}
|
||||
{...defaultProps}
|
||||
location={{
|
||||
pathname,
|
||||
}}
|
||||
avatarProps={{
|
||||
src: "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
|
||||
title: "七妮妮",
|
||||
size: "small",
|
||||
}}
|
||||
actionsRender={(props) => {
|
||||
if (props.isMobile) return [];
|
||||
return [
|
||||
<InfoCircleFilled key="InfoCircleFilled" />,
|
||||
<QuestionCircleFilled key="QuestionCircleFilled" />,
|
||||
<GithubFilled key="GithubFilled" />,
|
||||
];
|
||||
}}>
|
||||
<PageContainer>
|
||||
<ProCard
|
||||
style={{
|
||||
height: "100vh",
|
||||
minHeight: 800,
|
||||
}}>
|
||||
<div>
|
||||
<Outlet />
|
||||
</div>
|
||||
</ProCard>
|
||||
</PageContainer>
|
||||
</ProLayout>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user