Retrieve computed derived state based on the store. Getter functions receive the following positional arguments:
<template>
<div>
<div>Value = {{ getMyProperty }}</div>
<div>Value = {{ getStoredProp }}</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters([
'getMyProperty'
]),
// or, without helper...
getStoredProp: () => {
return this.$store.getters.getMyProperty;
}
}
}
</script>