咦?我滚动条呢?

来源:3-2 滚动条组件

losting

2020-01-05 10:25:44


继各种报错之后,我滚动条又没了。。。。之前插槽slot写成solt把我人都给找懵了,大伙儿帮看看又是哪儿打错了

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

写回答

4回答

好帮手慕码

2020-01-06

同学你好,老师测试你的代码确实是有滚动条的(换浏览器测试也是有的),如下:

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

可能是其他的页面影响到了,同学可以先和源码对比一下,哪里写的有问题。如果还是没有找到问题的话,且考虑到代码比较多,建议同学新建提问,将相关代码(home/index.vue和scroll/index.vue)都粘贴至问答区,以便准确的帮助同学分析解决问题!

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

0

好帮手慕码

2020-01-05

同学你好,老师测试同学提供的代码是有滚动条的,如下:

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

建议同学关闭项目后,重新启动测试一下(或者可以清除浏览器缓存)。

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

0
hosting
h 难受了,重启后滚动条还是没有,而且没有了下拉上拉的过度效果很生硬。。拉到一半还卡住了的样子。。。
h020-01-06
共1条回复

losting

提问者

2020-01-05

<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",
        slidesPerView: "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-05

同学你好,建议将代码粘贴至问答区进行提问,以便准确的帮助同学分析解决问题!

祝学习愉快~

0
hosting
h 。。。,找了好久都找不到。我整个人可能有bug了。。。可以把这个东西做个找不同的游戏。。
h020-01-05
共2条回复

0 学习 · 10739 问题

查看课程