Some time ago the company leader suggested that a demand is like a circle of friends, brush list has been brushed to the bottom or half of the center, and then click Back or leave the page, then quit to enter the friend Circle page is still realistic or the position of the previous scroll.
I am now doing the company after the system, the project list also has a lot of items, has been zoned AH row, click to see the details and then come back there is no location in the original project there, experience is not very good. Also took me a morning time, a variety of information, in fact, a morning did not fix. In fact, there are ideas. is to record the position of the scroll. The page that returns to the list of items is scrolled to the corresponding location. But it's not always. Previously written in the Vuejs life cycle of the activated inside does not work at all, this pit stepped for a long time. is simply a variety of debugging to find information. Activated this thing to be used in conjunction with keep-alive, is actually using the component cache.
The code is as follows: App.vue
Important important content of red word denotes
Vuejs life cycle updated is only executed after several innings have been loaded.
Project.vue
Vuejs life Cycle Updated