Answer the question
In order to leave comments, you need to log in
TypeScript type error in computed method in Vue?
Good evening, I encountered such a problem that when returning a filtered array in a computed method consisting of ObjectOfCity, TS swears that I can specify bigCard as soon as any , although this is the same ObjectOfCity object
filteredBigCards(): ObjectOfCity[] {
return this.filters.length
? this.bigCardsList.filter((bigCard: <b>any</b>) =>
this.filters.find((filter: string) => bigCard.weather[`${filter}`])
)
: this.bigCardsList;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question