nuxt.js 使用vue-awesome-swiper提示getComputedStyle' on 'Window': parameter 1 is not of type 'Element'?

作者站长头像
站长
· 阅读数 20

nuxt.js 使用vue-awesome-swiper提示getComputedStyle' on 'Window': parameter 1 is not of type 'Element'?nuxt.js 使用vue-awesome-swiper提示Failed to execute getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

代码如下:

<div
      class="swiper-wrapper gallery-top"
      v-swiper:swiperTop1="swiperOptionTop"
      ref="swiperTop"
      @slideChange="onSlideChange"
    >
      <div class="swiper-slide" v-for="item in showImgs()" :key="item.id">
        <img :src="item.picUrl" @click="openNewWindow(item.forward)" class="gallery-img" />
      </div>
    </div>

网上有人说class需要使用swiper-wrapper,但是还不行,@slideChange="onSlideChange"也没出发

回复
1个回答
avatar
test
2024-06-19
回复
likes
适合作为回答的
  • 经过验证的有效解决办法
  • 自己的经验指引,对解决问题有帮助
  • 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
  • 询问内容细节或回复楼层
  • 与题目无关的内容
  • “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容