[Vuejs]-Vuex action not updating state when calling from component everytime

0👍

My advice is to use a computed property, instead of a method

computed: {
  filteredPosts() {
    return this.$store.getters.getblogPost.map(x => x.category === this.$route.params.catName;
  }
}

computed properties are "more reactive" than methods. This way you rely on data reactivity and not to getting the right sequence of the methods

Leave a comment