whether the product data isNew is a new product, I want to add a picture as a separation between the new model and the old model. The data is in a list, and the background first gives the isNew is 1
how can I insert a picture in a for cycle
"findGoodsList":[
{
"isNew":1,
"sellingPoints":"Nike AS W NSW CREW ARCHIVE 2017 857089-133",
"goodsPrice":399,
"sharePrice":319.2,
"rebatePrice":39.9,
"goodsId":"0d2420561a1b4360ad5f6a73067f0510",
"stockNum":1,
"labelName":"NEW BALANCE",
"activeType":1,
"sizeName":"A"
},
}
my current implementation is to write two for and then judge it by v-if = "isNew==1", but I feel that this is not friendly. I would appreciate it if you give me an idea.
<ul class="product-list">
<li class="product-item" @click="$router.push({path: "/product", query:{id: item.productId}})" v-for="(item,index) in proData" **v-if="item.isNew==1"**
:key="index">
<div class="item-posre">
<img v-lazy="item.activityImg" alt="">
</div>
<div class="item-product-text">{{item.isNew}}{{item.sellingPoints}}</div>
<p class="original-price">:<i>{{item.goodsPrice|formatMoney}}</i>
<p class="item-product-info"> <span><i></i>{{item.sharePrice|formatMoney}}</span>
<button type="button" class="jx-btn" v-if="item.stockNum>0"></button>
<button type="button" class="jx-btn none" v-else> </button>
<!--<div class="size">:{{item.sizeName}}</div>-->
<!--<div class="size">:{{item.sizeName}}</div>-->
</li>
**<div v-if="bannerShow"><img style="width:100%" v-lazy="activity.bannerImg2" alt=""></div>**
<li class="product-item" @click="$router.push({path: "/product", query:{id: item.productId}})" v-for="(item,index) in proData" **v-if="item.isNew==0"**
:key="index">
<div class="item-posre">
<img v-lazy="item.activityImg" alt="">
</div>
<div class="item-product-text"> {{item.isNew}}{{item.sellingPoints}}</div>
<p class="original-price">:<i>{{item.goodsPrice|formatMoney}}</i>
<p class="item-product-info"> <span><i></i>{{item.sharePrice|formatMoney}}</span>
<button type="button" class="jx-btn" v-if="item.stockNum>0"></button>
<button type="button" class="jx-btn none" v-else> </button>
</li>
</ul>