cklmercer / vue-stash

Easily share reactive data between your Vue components.
MIT License
403 stars 29 forks source link

Understanding #21

Closed Wipsly closed 7 years ago

Wipsly commented 7 years ago

Hi,

I installed vue stash via npm and followed the instruction. I have two components. In the first component I call axios to update the username and set the username in the store. In my second component I have a navbar with username. Shouldn't they username be updated?

Thanks for you great work so far 👍

cklmercer commented 7 years ago

Did you define a username property in your store beforehand? You'll want to set it first so that it's reactive, just like any other property that you want to be reactive. If it helps, vue-stash simply adds a bunch of properties to you root vm data option and provides shortcuts to access them.

Wipsly commented 7 years ago

Thanks for your reply. I will show you my code example when I am back at home. Going to update this entry

cklmercer commented 7 years ago

Feel free to reopen this issue if necessary.