mirror of https://github.com/longtai-cn/hippo4j
parent
44162399da
commit
3be5bbdf71
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
echo "pre-commit";
|
||||
npm run lint;
|
@ -1,7 +1,31 @@
|
||||
import LayoutCom from './components/layout-com';
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import routeList from './route';
|
||||
import { AppstoreOutlined, MailOutlined } from '@ant-design/icons';
|
||||
|
||||
function App() {
|
||||
return <LayoutCom></LayoutCom>;
|
||||
}
|
||||
const sideMenuList = [
|
||||
{
|
||||
label: <a href="/about">about</a>,
|
||||
key: 'mail',
|
||||
icon: <MailOutlined />,
|
||||
},
|
||||
{
|
||||
label: <a href="/home">主页</a>,
|
||||
key: 'app',
|
||||
icon: <AppstoreOutlined />,
|
||||
},
|
||||
];
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<LayoutCom sideMenuList={sideMenuList} isSider={false}>
|
||||
<Routes>
|
||||
{routeList.map(item => (
|
||||
<Route key={item.path} path={item.path} Component={item.component} />
|
||||
))}
|
||||
</Routes>
|
||||
</LayoutCom>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
@ -0,0 +1,11 @@
|
||||
import { IRouterList } from '@/typings';
|
||||
import About from '.';
|
||||
|
||||
const routerList: IRouterList[] = [
|
||||
{
|
||||
path: '/about',
|
||||
component: About,
|
||||
},
|
||||
];
|
||||
|
||||
export default routerList;
|
@ -0,0 +1,5 @@
|
||||
import Home from './index';
|
||||
import { IRouterList } from '@/typings';
|
||||
|
||||
const routerList: IRouterList[] = [{ path: '/home', component: Home }];
|
||||
export default routerList;
|
@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { IRouterList } from '@/typings';
|
||||
import homeRouter from '@/page/home/router';
|
||||
import aboutRouter from '@/page/about/router';
|
||||
|
||||
const Fc = () => {
|
||||
return <div>hhh</div>;
|
||||
};
|
||||
const routerList: IRouterList[] = [...homeRouter, ...aboutRouter];
|
||||
export default routerList;
|
||||
|
@ -0,0 +1,13 @@
|
||||
import { ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
|
||||
export type IRouterList = {
|
||||
path: string;
|
||||
component: () => React.JSX.Element;
|
||||
};
|
||||
|
||||
export type IMenuList = {
|
||||
label: string | ReactNode;
|
||||
key: string;
|
||||
icon?: ReactNode;
|
||||
};
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue