jeft-vue-preview

vue-preview-plugin

Usage no npm install needed!

<script type="module">
  import jeftVuePreview from 'https://cdn.skypack.dev/jeft-vue-preview';
</script>

README

jeft-vue-preview

Installation

npm install jeft-vue-preview --save

Usage

引入

  • opts参数:
import preview from 'jeft-vue-preview'

Vue.use(preview, options)

在vue-photo-preview的基础上添加options.swiperName

目的可以使swiper点击图片放大关闭的时候更新swiper的index与preview的index一致

preview参数

| 参数 | 描述 |
|-------- | :-----: |
| options | options -> 与photoswipe的options一致 |
| swiperName   | string -> 在swiper的外层添加该class与ref
<swiper class='swiper-wrap square-swiper goodSquareSwiper' ref='goodSquareSwiper'></swiper>
Vue.use(preview, {
    swiperName: 'goodSquareSwiper'
})
    watch: {
      gallerySwiperIndex (newV) {
        const $goodSquareSwiper = this.$refs.goodSquareSwiper.swiper
        $goodSquareSwiper.slideTo(newV, 0)
      }
    }