react-router v4.1.1的二级路由点击后只改变URL,页面不跳转

我的结构是:container里三个一级路由分别为:首页,订单,库存。对应三个组件:index,orderform,repertory。现在订单这个组件中又有三个二级路由:全部订单,待处理订单,已发货订单。现在一级路由正常,二级路由点击只改变url,页面不跳转,哪位大神指点一下。。container代码如下:
importReact,{Component}from'react';
import{Layout,Menu,Icon,}from'antd';
import{BrowserRouterasRouter,Route,Redirect,Link,HashRouter}from'react-router-dom';
import'./index.less';
importIndexfrom'../pages/index/index';
importOrderformfrom'../pages/orderform/orderform';
importRepertoryfrom'../pages/repertory/repertory';
importcreateBrowserHistoryfrom'history/createBrowserHistory';
consthistory=createBrowserHistory();
const{Header,Sider,Content}=Layout;
trigger={null}
collapsible
collapsed={this.state.collapsed}
className="menu"
>
首页
订单
库存
className="trigger"
type={this.state.collapsed?'menu-unfold':'menu-fold'}
onClick={this.toggle}
/>
包含二级路由的订单页面代码如下:
importReact,{Component}from'react';
import{BrowserRouterasRouter,Route,Link}from'react-router-dom';
import{Tabs}from'antd';
importAlreadyfrom'../orders/already/already';
importAllfrom'../orders/all/all';
importPendingfrom'../orders/pending/pending';
classOrderformextendsComponent{
render(){
return(
全部订单
待处理订单
已发货订单
)
}
}
隔江千里
浏览 3236回答 2
2回答

牛魔王的故事

找到问题了。。。。。粗心大意啊。。component不是components大家引以为鉴!!
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript