官方文档 https://rockyxia.github.io/vue-superslide/#/

superslide只初始化一次,这里需要watch监听强制刷新dom

<superslide v-if="hackReset" :options="options" class="picScroll-left">
        <div class="bd">
          <ul class="picList">
            <li
              v-for="preview_imgs in preview_img"
              v-bind:key="preview_imgs.index"
              style="position:relative"
            >
              <div class="pic">
                <a href="javascript:;">
                  <img @mouseenter="enter()" @mouseleave="leave()" :src="preview_imgs"/>
                </a>
              </div>
            </li>
          </ul>
        </div>
        
          <div v-show="isshow" class="prev" slot="prev"></div>   
          <div v-show="isshow" class="next" slot="next"></div>
</superslide>


  watch: {
    preview_img() {
      this.hackReset = false;
      this.$nextTick(() => {
        this.hackReset = true;
      });
    }
  }

 

Logo

前往低代码交流专区

更多推荐