0👍
You should map your getters inside your components so they are not computed twice but instead reference the method in the getter.
import { mapGetters } from 'vuex'
export default {
// ...
computed: {
// mix the getters into computed with object spread operator
...mapGetters([
'doneTodosCount',
'anotherGetter',
// ...
])
}
}
more info can be found here:
https://vuex.vuejs.org/guide/getters.html#the-mapgetters-helper
- [Vuejs]-Module.exports is undefined when adding a class method
- [Vuejs]-Update a data property is not working on button click in vuejs
Source:stackexchange.com