以3n 为单位进行循环

 <template
              v-for="(item, index) in Math.ceil(warnInfo.length / 3)"
              :key="index + 'ca'"
            >
              <el-carousel-item>
                <div
                  v-for="(data, k) in warnInfo.slice(index * 3, item * 3)"
                  :key="k"
                >
                  <h3 class="tip" justify="center">{{ data }}</h3>
                </div>
              </el-carousel-item>
            </template>
 
跑马灯效果
posted @ 2022-12-13 14:18  燕林  阅读(20)  评论(0编辑  收藏  举报