Answer the question
In order to leave comments, you need to log in
Why isn't computed working in vue?
Computed does not work, the console does not complain. Perhaps the problem is in the async function
computed: {
// eslint-disable-next-line vue/return-in-computed-property
requests (){
this.$store.getters.requests.filter(request => {
if (this.$route.query.data) {
return this.$route.query.data === request.color
}
return request
})
.sort((a,b) => {
return a.id - b.id
})
}
},
async mounted() {
await this.$store.dispatch('getGallery')
},
Answer the question
In order to leave comments, you need to log in
You are not returning anything from the function.
Not just like this:
eslint-disable-next-line vue/return-in-computed-property
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question