简体   繁体   中英

Would vuex state management be useful in implementing a multi page app with django?

I have created a single page app before with Vue and Vuex for state management and am looking into multi page apps with the django backend framework. I am curious to know if there would be any pros to including vuex state management or would the backend take care of state management in this case?

Vuex still has use cases, even if you are navigating (and thus clearing the store) between pages.

  • You can create and restore a store from localStorage, allowing you to keep a local state between pages. Depending on how much data you try to store in the store this may be bad for performance.
  • When communicating between components, you usually do this with the prefered method of using props and events. However, when two components do not have a direct relation with each other, passing data through several components is usually a burden. You can either use a vuex store to manage shared data, or use a bus to make that easier.

That said, you probably only want to add a store when you feel the need to have one. Adding a store is usually trivial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM