v4版本应该也差不多的解决方法
思路很简单:就是在{this.props.children}渲染的地方进行处理,根据当前路由名称判断组件显示与隐藏。
children即this.props.children;
将children保存到全局windows中
save = (children) => {
this.routeName = children.props.route.name;
if (!window.routeCache) window.routeCache = {};
if (!window.routeCache[this.path]) window.routeCache[this.path] = {};
if (!window.routeCache[