简体   繁体   English

如何使 Vuetify 轮播图像响应,尤其是在移动屏幕上?

[英]how do I make Vuetify carousel images responsive especially on mobile screens?

I also tried effecting this with CSS but seems not to be working, I am aware Vuetify carousels are not quite responsive but I feel the Veutify team should have addressed such issue by now or is there a better way to achieve this?我也尝试过使用 CSS 来实现这一点,但似乎不起作用,我知道 Vuetify 轮播不太敏感,但我觉得 Veutify 团队现在应该已经解决了这个问题,还是有更好的方法来实现这个?

 <v-flex xs12 md8  lg6 >
             <v-carousel  style="border-radius:4px; "  height="400px" class="slides">
        <v-carousel-item
          class="slides"
          v-for="(item,i) in items"
          :key="i"
          :src="item.src"
          reverse-transition="fade-transition"
          transition="fade-transition" 
          
          >
          </v-carousel-item>
      </v-carousel>
          </v-flex>

Vuetify carousel is honestly an awful carousel component Vuetify 轮播确实是一个糟糕的轮播组件

I can't count the amount of people I've seen complain about its lack of responsiveness我数不清有多少人抱怨它缺乏响应能力

There's no "Vuetify" way of doing what you want to do and you can't use <v-responsive> to fix which leaves you with two main options:没有“Vuetify”的方式来做你想做的事,你不能使用<v-responsive>来修复这让你有两个主要选择:

  1. Use a different component for a carousel.为轮播使用不同的组件。 Vuetify tree shakes so you're not wasting/saving any bundle size by using or not using it. Vuetify 树抖动,因此您不会通过使用或不使用它来浪费/保存任何包大小。 You can use a dedicated carousel plugin that's a lot more powerful, flexible and actually works properly on mobile.你可以使用一个专用的轮播插件,它更强大、更灵活,并且实际上可以在移动设备上正常工作。 This is the option I suggest.这是我建议的选项。
  2. Write a fair amount of custom CSS to overwrite parts of the component itself.编写大量自定义 CSS 来覆盖组件本身的部分内容。

Unfortunately there's not too much better of a solution.不幸的是,没有更好的解决方案。 I always advocate for just using a superior carousel component!我一直主张只使用高级轮播组件!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM