javascript - How to record the user's browsing position and update the partial view on the rollback list page of the details page?
学习ing
学习ing 2017-06-26 10:56:45
0
2
950

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
学习ing

reply all(2)
Ty80

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

仅有的幸福

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template