jeft-vue-preview
v0.1.0
Published
vue-preview-plugin
Downloads
9
Maintainers
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)
}
}