datagod/src/router/router.tsx
2020-11-06 18:36:21 +08:00

36 lines
826 B
TypeScript

import React from 'react';
import { BrowserRouter, Route, Switch, HashRouter, Redirect, Link } from 'react-router-dom';
import Home from '../pages/home';
class HomeRouter extends React.Component {
render() {
return (
<BrowserRouter>
<Switch>
<Route exact path="/" >
<Redirect to={{pathname: "/content"}} >
...{console.log("redirect")}
</Redirect>
</Route>
<Route path="/content" component={Home}>
</Route>
{/* <Route exact path="/home" component={Home} ></Route> */}
</Switch>
</BrowserRouter>
)
}
}
export default HomeRouter;