//router/index.js文件
import { HashRouter as Router, Route } from 'react-router-dom';
import { Routes } from 'react-router-dom';

import routes from './mapRoute';
//定义的路由函数直接挂载到主页面上去
const HRoutes = function () {
    console.log(routes);
    return (
        <Router>
            <Routes>
                {
                    routes.map((item, index) => {
                        return (
                            <Route key={index} path={item.path} element={item.component}></Route>
                        )
                    })
                }

            </Routes>
        </Router>
    )
}
export default HRoutes;