We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问一下,没有什么办法改变缓存页面的某个state,我对首页设置cache <Route index component={Home} path= '/home' cache /> 从其他页面返回后,我想根据路由传回的参数改变首页某项state的值,其他状态不变,不知道有没有什么好的办法解决
<Route index component={Home} path= '/home' cache />
The text was updated successfully, but these errors were encountered:
缓存恢复后的状态,是由渲染时刻的状态(state,location等)决定的。可以在组件里监听地址的变化,做相应的处理,目前监听地址变化的方法尚未开放(方案正在制定中),可以采用浏览器原生API如window.onhashchange来实现。
Sorry, something went wrong.
Good one: next version 3
@vifird window.onhashchange 无法监听到地址的变化,路由跳转是使用 Control.go('/home', { name: '我是名字' }) ,只有在点击浏览器的返回或者前进的时候触发 window.onhashchange 事件。
No branches or pull requests
请问一下,没有什么办法改变缓存页面的某个state,我对首页设置cache
<Route index component={Home} path= '/home' cache />
从其他页面返回后,我想根据路由传回的参数改变首页某项state的值,其他状态不变,不知道有没有什么好的办法解决
The text was updated successfully, but these errors were encountered: