UNPKG

react-whole-barrels

Version:

- [x] Es6/7 - [x] react/react-router/dva - [x] less - [x] dev-server - [x] 模块热替换(HMR) - [x] sourcemap - [x] CSS代码分割 - [x] 代码分割(SplitChunksPlugin) - [x] 浏览器缓存 - [x] tree shaking - [x] DellPlugin - [x] PWA - [x] eslint - [x] stylelint

29 lines (25 loc) 604 B
import React from 'react'; import PropTypes from 'prop-types'; import { routerRedux, Route, Switch, } from 'dva/router'; import Home from './home'; import Login from './login'; import './index.less'; const {ConnectedRouter} = routerRedux; export default function Router({history}) { return ( <ConnectedRouter history={history}> <Switch> <Route path="/" exact component={Login} /> <Route path='/login' component={Login}/> <Route path="/home" component={Home} /> </Switch> </ConnectedRouter> ); } Router.propTypes = { history: PropTypes.object };