123456789101112131415161718192021222324252627282930313233 |
- import React, { Component } from 'react';
- import { Redirect, Route, Switch } from 'dva/router';
- import { connect } from 'dva';
- import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
- import { getRoutes } from '../../../utils/utils';
- @connect()
- export default class Recommend extends Component {
- render() {
- const { match, routerData } = this.props;
- const routes = getRoutes(match.path, routerData);
- return (
- <PageHeaderLayout>
- <Switch>
- {
- routes.map(item =>
- (
- <Route
- key={item.key}
- path={item.path}
- component={item.component}
- exact={item.exact}
- />
- )
- )
- }
- <Redirect exact from="/frontend/recommend" to="/frontend/recommend/list" />
- </Switch>
- </PageHeaderLayout>
- );
- }
- }
|