【问题标题】:v-carousel skippping whenever it moves to the next itemv-carousel 在移动到下一个项目时跳过
【发布时间】:2021-11-07 16:19:55
【问题描述】:

每当 v-carousel 移动到卷轴中的下一个图像时,它会在加载图像之前缩小,从而导致轮播“跳过”。有什么办法可以防止这种情况发生吗?也许通过预加载图像?静态图像来自使用 asyncData 的父 nuxt 组件,所以我认为它已经被加载了。

轮播组件:

<template>
<v-container class="hero-wrapper">
  <v-carousel
    cycle
    hide-delimiters
    height="auto"
    >
    <v-carousel-item
      v-for="(item,i) in heroImages"
      :key="i"
      class="pb-0 mb-0"
      :href="item.link"
      >
      <img :src="item.image" class="hero-image">
    </v-carousel-item>
  </v-carousel>
</v-container>
</template>

<script>
export default {
    props: ["heroImages"]
}
</script>

【问题讨论】:

    标签: vue.js nuxt.js vuetify.js


    【解决方案1】:

    尝试将eager 属性添加到v-carousel-item

    <v-carousel-item
        v-for="(item,i) in heroImages"
        :key="i"
        eager
        class="pb-0 mb-0"
        :href="item.link"
    >
    

    【讨论】:

      猜你喜欢
      • 2021-12-12
      • 2016-07-25
      • 1970-01-01
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-26
      • 1970-01-01
      相关资源
      最近更新 更多