search

Home  >  Q&A  >  body text

javascript - How to record the user's browsing position and update the partial view on the rollback list page of the details page?

A single-page application made by angular, similar to Tieba forum.
Now the user's browsing list page scrolls to the bottom and the next page of data will be automatically loaded.
If the user clicks to enter the view details page and returns,
How to record the user's browsing position and update some partial views? (Such as the number of views and comments on a post),
Are there any good solutions?

学习ing学习ing2702 days ago937

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-06-26 10:58:45

    Use Vuex or Vuet for state management. You can read this Vue.js project reconstruction to easily restore the scroll position of pull-up loading

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-26 10:58:45

    There are many predecessors who have stepped on this pitfall when it comes to vue, and maybe angular too

    Propose a framework-independent solution

    You can use localstorage to cache the data information of the list page, which page parameters, and scroll bar height

    Or just record the page parameters and scroll bar height, and request again

    reply
    0
  • Cancelreply