Giter Club home page Giter Club logo

Comments (3)

progrape avatar progrape commented on July 26, 2024

路由本身不会帮你保存数据,你可以用一个变量把ajax加载的数据保存起来,渲染 A 的时候先检查那个变量有没有数据,如果没有数据,就发请求去加载,然后渲染页面;如果有数据了就直接用。

from router.

cgfeel avatar cgfeel commented on July 26, 2024

@progrape 假如我记录了A页面数据,切换回到A页面的时候,我怎么记录之前滚动的位置呢?

否则用户每次切换都要从顶部开始看内容。。。。。。

from router.

x-bean avatar x-bean commented on July 26, 2024

我的解决方案是:在t.$container.appendChild(a)之前加了这句话:t.$container.innerHTML='';直接清空之前的代码,虽然猥琐,也算是解决了问题

from router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.