Use v-for to traverse the array in vue3, use it when displaying, and split

1. In the vue project, we usually use v-for to traverse the array and display it. When displaying multiple data, we need to think about how to use it to separate the data

algConfig.manualAncestors is the array you are currently traversing, and index is used to determine how many items there are in the current array

 <template v-for="(item, index) in algConfig.manualAncestors" :key="index" >
    {
   
   { (index == algConfig.manualAncestors?.length - 1 && item.name) || item.name + ","}}
</template>

2. Effect display

 

Supongo que te gusta

Origin blog.csdn.net/m0_52761651/article/details/130014161
Recomendado
Clasificación