1.0.2 • Published 4 years ago

v-photoswipe-updated-btn-titles v1.0.2

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

Vue PhotoSwipe with English Language Button Titles

npm

PhotoSwipe, PhotoSwipeGallery component for Vuejs base on PhotoSwipe.

This is the same exact library as v-photoswipe, but with English language button titles. v-photoswipe a perfectly functioning library, I just had to update the button titles by request from my client.

Installation

NPM

  npm i v-photoswipe-updated-btn-titles

Usage

Template

<template>
  <div>
    <div class="paragraph">
      <h3>PhotoSwipe</h3>
      <div>
        <img @click="showPhotoSwipe(0)" src="https://farm4.staticflickr.com/3894/15008518202_c265dfa55f_h.jpg" alt="">
        <img @click="showPhotoSwipe(1)" src="https://farm4.staticflickr.com/3902/14985871946_24f47d4b53_h.jpg" alt="">
      </div>
    </div>
    <div class="paragraph">
      <h3>PhotoSwipe Gallery</h3>
      <div>
        <v-photoswipe-gallery :isOpen="isOpenGallery" :options="optionsGallery" :items="items">
          <img slot-scope="props" :src="props.item.src" alt="picture"/>
        </v-photoswipe-gallery>
      </div>
    </div>
    <v-photoswipe :isOpen="isOpen" :items="items" :options="options" @close="hidePhotoSwipe"></v-photoswipe>
  </div>
</template>  

JS

import { PhotoSwipe, PhotoSwipeGallery } from 'v-photoswipe'
export default {
  components: {
    'v-photoswipe': PhotoSwipe,
    'v-photoswipe-gallery': PhotoSwipeGallery
  },
  data () {
    return {
      isOpen: false,
      isOpenGallery: false,
      options: {
        index: 0
      },
      optionsGallery: {},
      items: [
        {
          src: 'https://farm4.staticflickr.com/3894/15008518202_c265dfa55f_h.jpg',
          w: 1600,
          h: 1600,
          title: 'This is dummy caption.'
        }, {
          src: 'https://farm4.staticflickr.com/3902/14985871946_24f47d4b53_h.jpg',
          w: 1600,
          h: 1066,
          title: 'This is dummy caption. It has been placed here solely to demonstrate the look and feel of finished, typeset text.'
        }
      ]
    }
  },
  methods: {
    showPhotoSwipe (index) {
      this.isOpen = true
      this.$set(this.options, 'index', index)
    },
    hidePhotoSwipe () {
      this.isOpen = false
    }
  }
}  

Props

PhotoSwipe & PhotoSwipeGallery

NameTypeDefaultRequiredDescription
isOpenBooleanfalsetrue
itemsArray[]trueDocument
optionsObject{}fasleDocument
beforeChangeFunctionPhotoswipe event listener
afterChangeFunctionPhotoswipe event listener
imageLoadCompleteFunctionPhotoswipe event listener
resizeFunctionPhotoswipe event listener
gettingDataFunctionPhotoswipe event listener
mouseUsedFunctionPhotoswipe event listener
initialZoomInFunctionPhotoswipe event listener
initialZoomInEndFunctionPhotoswipe event listener
initialZoomOutFunctionPhotoswipe event listener
initialZoomOutEndFunctionPhotoswipe event listener
parseVerticalMarginFunctionPhotoswipe event listener
closeFunctionPhotoswipe event listener
unbindEventsFunctionPhotoswipe event listener
destroyFunctionPhotoswipe event listener
updateScrollOffsetFunctionPhotoswipe event listener
preventDragEventFunctionPhotoswipe event listener
shareLinkClickFunctionPhotoswipe event listener

Slot

PhotoSwipeGallery

NameTypeDefaultRequiredDescription
itemObjectHTML Img Tagfalse

Demo

coming soon...

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago