v-for traverses objects (value, key, index) and traverses arrays (item, index)

Three values ​​can be passed in when traversing the object

If one is passed in, it is item, which is the value of the object;

If two values ​​are passed in, that is item and key, that is the key (key) and value (item) of the object;

If three values ​​are passed in, that is item, key and index, index is the serial number of the object 0, 1, 2...

Two values ​​can be passed in when traversing the array

If one is passed in, it is item, which is the value of each item in the array

If two are passed in, it is item and index, index is the serial number of the array 0, 1, 2...

Guess you like

Origin blog.csdn.net/WYB_BOOM/article/details/126860838