设置了.swiper-slide样式,却没有出现滚动条?

来源:3-2 滚动条组件

慕婉清9255496

2020-01-17 15:29:01

http://img.mukewang.com/climg/5e21621b09cf2ae702100225.jpg


http://img.mukewang.com/climg/5e21623509a6d60a12160595.jpg

写回答

3回答

好帮手慕夭夭

2020-01-17

同学你好,是因为配置中,有一个单词拼错,如下修改:

改为slidesPerView

http://img.mukewang.com/climg/5e217b0f0991a69f04540130.jpg

如果我的回答帮助到了你,欢迎采纳,祝学习愉快~

0

慕婉清9255496

提问者

2020-01-17

<template>
  <swiper :options="swiperOption">
    <swiper-slide>
      <slot></slot>
    </swiper-slide>
    <div class="swiper-scrollbar" v-if="scrollbar" slot="scrollbar"></div>
  </swiper>
</template>

<script>
  import {swiper, swiperSlide} from 'vue-awesome-swiper';
  export default {
    name: 'MeScroll',
    components: {
      swiper,
      swiperSlide
    },
    props: {
      scrollbar: {
        type: Boolean,
        default: true
      }
    },
    data() {
      return {
        swiperOption: {
          direction: 'vertical',
          sliderPerView: 'auto',
          freeMode: true,
          setWrapperSize: true,
          scrollbar: {
            el: this.scrollbar ? '.swiper-scrollbar' : null,
            hide: true
          }
        }
      };
    }
  };
</script>

<style lang="scss" scoped>
  .swiper-container {
    overflow: hidden;
    width: 100%;
    height: 100%;
  }
  .swiper-slide {
    height: auto;
  }
</style>


0

好帮手慕夭夭

2020-01-17

同学你好,请把项目中自己写的代码都粘贴到问答区,以便老师定位问题。

祝学习愉快!

0

0 学习 · 10739 问题

查看课程