Add a shipping address to vuex Mall and store it in store without refreshing the page to automatically render the data.

problems with store data access in vuex

add the shipping address, which is stored in store, and return to the current page after adding it. Why does the data automatically read the information in the shipping address and need to refresh it?

1.

clipboard.png

clipboard.png

// (mutations.js)


// store


storelocal storage,

clipboard.png

computedstore

//


clipboard.png

tell me my idea: store updates store data in real time according to whether there is an address, and then I check that computed loads data only when the page is loaded. How can I update computed data as soon as my data changes?

Nov.25,2021

1.computed is not executed when it is not loaded, but depends on the execution of
2 if there are changes. You can use watch


vuex's getter to act on Computed

Menu