老师你好~

老师你好~








http://img1.sycdn.imooc.com//climg/5e61fd5b09794ef800000000.jpg

代码如下

<template>

 <swiper :options="swiperOption" ref="swiper">

     <swiper-slide>

         <slot></slot>

     </swiper-slide>

 </swiper>

</template>

          

<script >

  import{ swiper, swiperSlide} from 'vue-awesome-swiper';


  export default{

   name:'MeScroll',

   components: {

       swiper,

       swiperSlide

   },

   props: {

       scrollbar: {

           type: Boolean,

           default: true

       }

   },

   data: {

       type:[Array,Object]

   },

   data() {

       return {

       swiperOption:{

         direction: 'vertical',

          slidesPerView: 'auto',

         freeMode: true,

          setWrapperSize: true,

          scrollbar: {

           el: this.scrollbar ? '.swiper-scrollbar' : null,

            hide: true

          }

       }

   }

   },

   watch:{

     data(){

         this.updata();

     }

   },

   methods:{

       updata(){

          this.$refs.swiper&&this.$refs.swiper.swiper.update();

       }

   }

  }

</script>



<style lang="scss" scoped>

 .swiper-container {

     overflow: hidden;

     width:100%;

     height:100%;

 }


 .swiper-slide{

     height: auto;

 }

</style>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕星星 2020-03-06 18:47:05

同学你好,可以查看私信,老师在私信中解决。

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星

相似问题

登录后可查看更多问答,登录/注册

请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师