D
D
Daksin2021-11-15 13:45:43
Vue.js
Daksin, 2021-11-15 13:45:43

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

1 answer(s)
A
AndromedaStar, 2021-11-15
@Daksin

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 question

Ask a Question

731 491 924 answers to any question