查看: 1792|回复: 1
打印 上一主题 下一主题

指示器hover问题

[复制链接]
  • TA的每日心情
    开心
    2021-12-18 19:04
  • 签到天数: 1 天

    [LV.1]初来乍到

    1

    主题

    5

    帖子

    15

    积分

    新手上路

    Rank: 1

    积分
    15
    跳转到指定楼层
    楼主
    发表于 2021-10-29 09:05:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    // 使用了 自定义分页器,但是需要使用hover分页器切换图片,浏览器没有缓存的时候第一次加载,会导致hover分页器无法使用原因是// `bullets`没有长度,不知道各位大神有没有解决办法
    renderBullet: (index, className) => {
      return `<span class="${className}">
                 <div>
                   <span class="title">${manipulatingFont(this.setBanner[index].title, 30)}</span>
                   <span class="info">${this.setBanner[index].description ? manipulatingFont(this.setBanner[index].description, 40) : ''}</span>
                 </div>
                 <span class="hui"></span>
              </span>`;
    }methods: {etJurisdiction(as) {
      setTimeout(() => {
        console.log(1)
        for (let i = 0; i < as.bullets.length; i++) {
          console.log(2)
          const that = this;
          as.bullets[i].index = i
          as.bullets[i].onmouseover = function() {
            that.mySwiper.slideTo(this.index + 1);
            that.mySwiper.autoplay.stop()
          };
          as.bullets[i].onmouseleave = function() {
            that.mySwiper.autoplay.start()
          };
          as.bullets[i].onclick = function() {
            if (that.setBanner[this.index].url) {
              window.location.href = that.setBanner[this.index].url
            }
          }
        }
      }, 1000)
    }}

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

    使用道具 举报

    该用户从未签到

    0

    主题

    10

    帖子

    20

    积分

    新手上路

    Rank: 1

    积分
    20
    沙发
    发表于 2021-11-2 16:02:10 | 只看该作者
    组件初始化数据前添加loading,template里面swiper组件上添加v-if="!loading"
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

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

    GMT+8, 2024-4-27 11:30 , Processed in 0.060365 second(s), 26 queries .

    Powered by Discuz! X3.2

    © 2001-2013 Comsenz Inc.

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