Reputation: 1500
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
how to make it work so that the computed property returns on the same line?
thanks for everything
Upvotes: 0
Views: 440
Reputation: 14904
Actually you shouldnt do it like that. Its described in the docs
https://v2.vuejs.org/v2/guide/instance.html#Lifecycle-Diagram
Upvotes: 3