[Vuejs]-Vuex dispatch doesn't return data in view

1👍

Method Currency is already defined as props. remove this in your code.

props:['currency']

Ten call this currency in your component like this

<div>
   {{this.$store.getters.currency.name}}
</div>

to surely display the currency, what I did is to put first a condition to check if it is was already loaded. like this

<div v-if="$store.getters.currency">
      {{this.$store.getters.currency.name}}
  </div>

or declare a new variable in your data like

data() {
   return {
       currency: this.$store.getters.currency.name
   }
}

now you could call it this way

<div v-if="$store.getters.currency">
     {{currency.name}}
</div>

Leave a comment