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
情况如下: 1.有A、B两个页面 2.A页面通过ajax传入数据进来 3.切换B页面(通过router来实现),再换回A页面,之前加载的AJAS数据没有了。请问怎么解决?
The text was updated successfully, but these errors were encountered:
路由本身不会帮你保存数据,你可以用一个变量把ajax加载的数据保存起来,渲染 A 的时候先检查那个变量有没有数据,如果没有数据,就发请求去加载,然后渲染页面;如果有数据了就直接用。
Sorry, something went wrong.
@progrape 假如我记录了A页面数据,切换回到A页面的时候,我怎么记录之前滚动的位置呢?
否则用户每次切换都要从顶部开始看内容。。。。。。
我的解决方案是:在t.$container.appendChild(a)之前加了这句话:t.$container.innerHTML='';直接清空之前的代码,虽然猥琐,也算是解决了问题
No branches or pull requests
情况如下:
1.有A、B两个页面
2.A页面通过ajax传入数据进来
3.切换B页面(通过router来实现),再换回A页面,之前加载的AJAS数据没有了。请问怎么解决?
The text was updated successfully, but these errors were encountered: