The vue js variable is used in CSS to set the width according to the number of arrays to achieve a row arrangement

<div class="Ditem" :style="{width:movie_width+'rem'}"></div>
 mounted () {
    this.movie_width = this.movieslist.length * 4.16
  },
.Ditem {
      height: 2.4rem;
      display: flex;
      justify-content: space-between;
    }

Guess you like

Origin blog.csdn.net/qq_59175937/article/details/128111655