How to change the image address of img based on the values in the passed-in array by vue

        <div class="collection">
          <ul>
            <li v-for="item in collectionList.slice(0,5)">
              <router-link :to="{name:"/games",params:{gameId:item.gameId}}" >
                <img :src="item.url">
                <div class="count_down">
                  <h2>{{item.Name}}</h2>
                </div>
              </router-link>
            </li>
          </ul>
        </div>

for example, I have 5 background images, and there are 25 objects in the array. Every five of them use the same background image, which is distinguished by the value of Collect in the array. Five objects are randomly passed in, and then the background image item.url of five objects is displayed according to the value of Collect.

Aug.02,2021

you can add a corresponding address of the silhouette image to each object, and randomly pass it in and directly take the image address of the object you add.

Menu