jeft-vue-preview

0.1.0 • Public • Published

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)
      }
    }

Package Sidebar

Install

npm i jeft-vue-preview

Weekly Downloads

0

Version

0.1.0

License

none

Unpacked Size

684 kB

Total Files

8

Last publish

Collaborators

  • jeft-hai