the array returned by the background is
["5", "1", "3", "2", "1",]
page to achieve the corresponding number of yellow stars
(for example: 5, five yellow stars, the default is five gray stars, here is a picture, I hope you don"t misunderstand):
data in default item:
stars:[
{starsUrl:"./img/net_more/star_off.png"},
{starsUrl:"./img/net_more/star_off.png"},
{starsUrl:"./img/net_more/star_off.png"},
{starsUrl:"./img/net_more/star_off.png"},
{starsUrl:"./img/net_more/star_off.png"},
],
path of yellow stars:
{starsUrl:"./img/net_more/star_on.png"},
the current page code is as follows:
<li class="buy_will">
<span class="buy_stars" >
<img class="stars" v-for="star in item.stars" :src="star.starsUrl" alt="1">
</span>
</li>
so the question is, how do you replace the yellow stars according to the numbers in the array?
li is traversed by vFF = "item in items", and stars is an array of objects in the items object