vue:
var app=new Vue({
el:".xiaomi",
data: {
typeInfo: [{img:"image/type/phone_1.webp",name:"Xiaomi 12 Pro",price:"4699"},
{img:"image/type/phone_2.webp",name:"Rog5s",price:"4999"},
],
},
methods: {
},
created: function () {
}
});
html:(给下标索引为1的加上边框)
<ul>
<li v-for("info,index")in typeInfo></li>
<span class="div1" v-if('index[1]')></span>//有边框
<span class=""></span>//没有边框
</ul>