0

I'm new to vue js. I have a parent component with 2 child components inside. After first child component is loaded vueex store function is called and will update params value which is passed to second child component.

this.store.getparams

Issue is once parent is completely loaded. When second child is clicked it's not fetching new params value as parent is still holding old value. Can anyone suggest pls.

Pratz09
  • 1
  • 3
  • need more info/code to help – Daniel Aug 23 '22 at 20:20
  • Basically I have a parent component in which below two child components are present the first child loads and sets a property in store. Which is then passed to second child component. But on initial load of parent it's working fine but on click of second child the stored value is not updating in parent – Pratz09 Aug 24 '22 at 00:56
  • Need code for all three components related to getting store states. You might be fetching it the wrong way in which case the global state will not be reactive and thus will not be synced to store. Check my answer to this: https://stackoverflow.com/questions/71676111/vue-component-doesnt-update-after-state-changes-in-pinia-store/71677026#71677026 – Fanoflix Aug 24 '22 at 06:47
  • If you get the state from the store the correct way, then no matter which component changes the state, you will always have the updated state everywhere. – Fanoflix Aug 24 '22 at 07:05

0 Answers0