Yung Silva
Yung Silva

Reputation: 1500

return of arrow function on the same line, typescript

I have the following code:

computed: {
  todos(): Todo[] {
    return this.$store.getters['todos/list']
  }
}

but I would like something like this::

computed: {
  todos: (): Todo[] => this.$store.getters['todos/list']
}

nas I get the following error

enter image description here

on terminal enter image description here

how to make it work so that the computed property returns on the same line?

thanks for everything

Upvotes: 0

Views: 440

Answers (1)

Ilijanovic
Ilijanovic

Reputation: 14904

Actually you shouldnt do it like that. Its described in the docs

enter image description here

https://v2.vuejs.org/v2/guide/instance.html#Lifecycle-Diagram

Upvotes: 3

Related Questions