import { HashRouter as Router, Route } from 'react-router-dom'
import createHistory from 'history/createHashHistory'
const history = createHistory()
<Router history={history}>
<Route render={({ location }) => {
return(
<div>
<Route location={location} exact path="/" component={Home} />
<Route location={location} path="/detail/:id" component={Detail} />
<Route location={location} path="/comment/:id" component={Comment} />
</div>
)}}/>
</Router>
react 打包出现空白页面报错
最新推荐文章于 2024-05-25 07:10:24 发布