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
- [Vuejs]-How to extract the value of textbox (V-Model)?
- [Vuejs]-Wrapping dynamically added child elements in my slot
Source:stackexchange.com