A
A
Alexander2018-12-28 11:34:57
Vue.js
Alexander, 2018-12-28 11:34:57

How to implement the history of the application in Vue.js?

Good afternoon.
Can you tell me how you can implement the historicity of SPA?
I mean not only for the router (history-mode), but also the storage of the states of other components.
For example, there is a sign, we return, the page on which the user was, the selection that the user left, the value of the filters, and so on, is saved there.
I understand that you can put the history in LocalStorage and, depending on the page and its components, give them saved states. While I think in this vein.
Are there any other approaches?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artray, 2018-12-28
@alexTitakoff

keep-alive
https://ru.vuejs.org/v2/api/#keep-alive

<keep-alive>
    <router-view />
</keep-alive>

https://codepen.io/anon/pen/MZEKYX

A
Anton Anton, 2018-12-28
@Fragster

Store everything in vuex store

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question