How do I share variables between several pages of vue?

after index.html logs in on login.html, the user name information is sent from the background.
then the page jumps to another.html,. How can the user name information be shared on other pages?

Mar.12,2021

localStorage,sessionStorage,cookie can transmit information across pages. How to use it depends on your project


http://www.lixuejiang.me/2016.


see what project you have structured
single page. The HTML page corresponding to load can declare a global variable
if it is a separate single page mode, it should be stored locally (localStorage and sessionStorage),) Cookie or Url bring parameters to transfer across pages.


vuex or localStorage,sessionStorage,cookie


username information is not suitable for caching. For security reasons, it is recommended that you use vuex.
vuex document address

.
Menu