|
|
@@ -1,5 +1,5 @@
|
|
|
import React, { Component } from "react";
|
|
|
-import { Route, Switch, Link, withRouter} from "react-router-dom";
|
|
|
+import { Route, Switch, Link, withRouter } from "react-router-dom";
|
|
|
import Overview from "../../components/Overview/overview";
|
|
|
import indexBasicInfo from "../../components/indexBasicInfo/indexBasicInfo";
|
|
|
import stocksApiList from "../../StocksApiList";
|
|
|
@@ -26,7 +26,7 @@ class NavBar extends Component {
|
|
|
const pathNames = this.props.history.location.pathname;
|
|
|
let defaultS = [];
|
|
|
defaultS.push(pathNames);
|
|
|
- // console.log(defaultS)//实时根据当前路径更新
|
|
|
+ // console.log(defaultS)//实时根据当前路径更新
|
|
|
return (
|
|
|
<Layout style={{ minHeight: "100vh" }}>
|
|
|
<Header className="header">BoNiu</Header>
|
|
|
@@ -42,15 +42,13 @@ class NavBar extends Component {
|
|
|
<Menu.Item key="overview" icon={<UserOutlined />}>
|
|
|
<Link to="/overview">总体说明</Link>
|
|
|
</Menu.Item>
|
|
|
- <SubMenu
|
|
|
- key="stocks"
|
|
|
- icon={<LaptopOutlined />}
|
|
|
- title="股票接口"
|
|
|
- >
|
|
|
+ <SubMenu key="stocks" icon={<LaptopOutlined />} title="股票接口">
|
|
|
{stocksApiList.map((item) => {
|
|
|
return (
|
|
|
<Menu.Item key={item.key}>
|
|
|
- <Link to={{pathname: item.url, state: item.data}}>{item.name}</Link>
|
|
|
+ <Link to={{ pathname: item.url, state: item }}>
|
|
|
+ {item.name}
|
|
|
+ </Link>
|
|
|
</Menu.Item>
|
|
|
);
|
|
|
})}
|
|
|
@@ -63,7 +61,9 @@ class NavBar extends Component {
|
|
|
{indexApiList.map((item) => {
|
|
|
return (
|
|
|
<Menu.Item key={item.key}>
|
|
|
- <Link to={{pathname: item.url, state: item.data}}>{item.name}</Link>
|
|
|
+ <Link to={{ pathname: item.url, state: item }}>
|
|
|
+ {item.name}
|
|
|
+ </Link>
|
|
|
</Menu.Item>
|
|
|
);
|
|
|
})}
|
|
|
@@ -93,4 +93,4 @@ class NavBar extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default withRouter(NavBar)
|
|
|
+export default withRouter(NavBar);
|