Answer the question
In order to leave comments, you need to log in
Why isn't the computed property updated?
computed: {
...mapGetters(['products', 'categories']),
category () {
return this.categories.find(category => category.id === this.$route.params.category)
}
},
Answer the question
In order to leave comments, you need to log in
category.id === this.$route.params.category
$route.params.category
? And doesn't it sound like you're trying to compare values of different types? - let's say category.id is a number and params.category is a string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question