On this page, it says that:
In situations where computed properties are not feasible (e.g. inside nested v-for loops), you can use a method
However, I am able to use computed props inside a nested v-for loop (check fiddle)
new Vue({
el: '#sample',
data() {
return {
numbers: [1, 2, 3, 4, 5]
}
},
computed: {
even() {
return this.numbers.filter(n => n % 2 === 0)
}
}
})
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<div id="sample">
<div v-for="n in numbers">
{{n}}
<div v-for="e in even">
..{{e}}
</div>
</div>
</div>
What am I missing?