vue如何在遍历时根据索引判断样式

<img v-for="(img,index) in item.imgs" 
:style="{marginLeft:index==0?'0':'5px'}" 
:src="'img/'+img.imgSrc" :alt="index"/>

猜你喜欢

转载自blog.csdn.net/qinkaiyuan94/article/details/79835637