解决办法 react-router-dom引入withRouter 使用withRouter()包住导出的组件 import { BrowserRouter as Router, Switch, Route, history, Link, withRouter } from "react-router-dom"; export default withRouter(ShowPlan)