查看: 1608|回复: 0
打印 上一主题 下一主题

vue中,swiper分页加载不出来,事件也不能触发

[复制链接]
  • TA的每日心情

    2020-2-20 12:15
  • 签到天数: 3 天

    [LV.2]偶尔看看I

    1

    主题

    9

    帖子

    16

    积分

    新手上路

    Rank: 1

    积分
    16
    跳转到指定楼层
    楼主
    发表于 2020-2-20 12:55:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    框架:vue-cli2 swiper4 vue-awesome-swiper3.1.3

    能正常显示swiper,能正常自动轮播和滑动,就是分页器加载不出,on里的事件也无法响应,求大神们指导,谢谢
    1. <swiper :options="swiperOption" ref="mySwiper">
    2.     <swiper-slide v-for="item in componentData.tags" :key="item.id">
    3.       <div   class="ladies-tag" :style="{ backgroundColor: getBgColor(item.bgstyle) }"   @click="toDetail(item.linkpath)" >
    4.        <div class="ladies-tag-title">{{ item.title }}</div>
    5.        <div class="ladies-tag-tagimg">
    6.        <img :src="item.imgpath" :onerror="defaultImg" />
    7.        </div>
    8.       </div>
    9.   </swiper-slide>
    10.   <div class="swiper-pagination" slot="pagination"></div>
    复制代码
    1. data() {
    2.   return {
    3.     swiperOption: {
    4.         slidesPerView: 'auto',
    5.         freeMode: true,
    6.         freeModeMomentumRatio: 1,
    7.         freeModeMomentumVelocityRatio: 1,
    8.         freeModeMomentumBounce: false,
    9.        pagination: {
    10.          el: '.swiper-pagination',
    11.          clickable: true
    12.       },
    13.      on: {
    14.         slideChangeTransitionStart: function() {
    15.         console.log('slideChangeTransitionStart')
    16.     }
    17.   }
    18. }
    19.     }
    20.   },
    复制代码


    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏 分享分享 分享淘帖
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|Swiper中文网 ( 粤ICP备15001020号

    GMT+8, 2024-4-20 17:09 , Processed in 0.065802 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表