我的结构是: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;首页订单库存包含二级路由的订单页面代码如下: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(全部订单待处理订单已发货订单)}}
添加回答
举报
0/150
提交
取消