ok 案例:
<ul>
<li v-for="item in cards" :class="[item.bg]">
<img :src="item.img">
<div>
<h6>{{item.title}}</h6>
<span>60</span>
</div>
</li>
</ul>
const cards=[
{
title:'订单数量',
img:require('../assets/images/summary1.png'),
bg:'b1',
prop:''
},
{
title:'支付订单数',
img:require('../assets/images/summary2.png'),
bg:'b2',
prop:''
},
{
title:'成交总金额',
img:require('../assets/images/summary3.png'),
bg:'b3',
prop:''
}
]
不ok的做法:
{
title:'成交总金额',
img:'../assets/images/summary3.png',
bg:'b3',
prop:''
}