When using an object array, is it possible to simultaneously assign the current object to a variable and deconstruct its properties in a v-for
loop? like this:
<div v-for="(person = {name, age}, index) in persons">
Ultimately I would like to be able to use both the entire person
object and its properties in the template.
As far as I know, you can't do both at the same time.
However, you can deconstruct it, for example:
You can then access the correct element via the index:
persons[index]
.Example: