0👍
✅
You can still use a method:
export default {
data () {
return {
authors: []
}
},
methods: {
findAuthor (id) {
return this.authors.find(x => x.id === id)
}
}
}
<ul>
<book v-for="book in books"
:book="book"
:author="findAuthor(book.author)">
</book>
</ul>
Source:stackexchange.com