获取html文件#后面的部分: 添加onhashchange事件,监听路由变化: 完整代码: 效果: react-router实现原理 react-router实现原理 react-router实现原理 react-router实现原理