美文网首页前端新手
利用swiper 实现上拉下拉回弹效果

利用swiper 实现上拉下拉回弹效果

作者: 刘员外__ | 来源:发表于2019-01-18 10:30 被阅读0次
    <template>
        <div>
            <swiper :options="swiperOption" class="swiper">
                <swiper-slide class="text">
                    <div>写入大量内容</div>
                </swiper-slide>
            </swiper>
        </div>
    </template>
    
    <script>
    import { swiper, swiperSlide } from 'vue-awesome-swiper'
    import 'swiper/dist/css/swiper.css'
        export default {
            data() {
                return {
                    swiperOption: {
                        direction:'vertical',
                        slidesPerView:'auto',
                        freeMode:true,
                        mousewheel:true,
                    }
                }
            },
            components: {
                swiper,
                swiperSlide
            },
        }
    </script>
    
    <style scoped>
        .swiper{
            height: 300px;
            overflow: hidden;
        }
        .text{
            font-size: 18px;
            text-align: left;
            padding: 30px;
            box-sizing: border-box;
            height: auto;
        }
    </style>
    

    相关文章

      网友评论

        本文标题:利用swiper 实现上拉下拉回弹效果

        本文链接:https://www.haomeiwen.com/subject/slwgdqtx.html