When VUE-CLI works on a project, how can the requested data be saved as a global?

for example, the user logs in and gets the user data after the login is successful. What if there are multiple JS files that need user data?


two solutions:
store the retrieved data in local local storage or in vueX


vuex, refresh the page will be lost. It is recommended that sessionStorage


vuex is responsible for communication between components. If it does not cooperate with storage, refreshing the page will lead to data loss. Then storage is divided into local and session, with different life cycle, so it can be used reasonably according to the needs. If you save login information, it's best to use localstorage.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46025-44b92.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46025-44b92.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?