Previewer
Install

Install

please avoid using large pictures or they may crash your browser(especially on Android).

example for list:

[{
  msrc: 'https://placekitten.com/500/250',
  src: 'https://placekitten.com/800/400',
  w: 600,
  h: 400
},
{
  src: 'https://placekitten.com/1200/900',
  msrc: 'https://placekitten.com/120/90', // thumbnail
  w: 1200,
  h: 900
}]

before v2.4.0, w and h should be specified.

Prevewing an image by index:

this.$refs.previewer.show(index)

API

Props

nametypedefaultdescriptionrequired version
listarrayimages list--
optionsobjectoptions for photoswipe--

Events

nameparamsdescriptionrequired version
@on-close--fires after closingv2.2.1-rc.4
@on-index-change--fires after index changes(shall not fire on first opening slide)v2.8.1

Slots

namedescriptionrequired version
button-afterslot after control button listv2.6.3
button-beforeslot before control button listv2.6.3

Functions

nameparamsdescriptionrequired version
goTo(index)go to specified imagev2.5.10
prevgo to previous imagev2.5.10
v2.9.1go to next imagev2.5.10
getCurrentIndexget current indexv2.6.3


Contributors

Contributors

Total commits quantity: 33,Total contributors quantity: 2

airylandickeep

Changelog

Releases

  • v2.8.1 [feature] add event:on-index-change #2505
  • v2.6.4 [feature] automatically update view if one slide is deleted
  • v2.6.3 [fix] fix method name starts with _ will get vue(2.4.4) warning #2001
  • v2.6.3 [feature] add method:getCurrentIndex
  • v2.6.3 [feature] add slot:button-before slot:button-after
  • v2.5.10 [enhance] Support method:goTo #1888
  • v2.4.0 [enhance] Use src as msrc by default
  • v2.4.0 [enhance] No more force setting width and height #1426
  • v2.2.1-rc.4 [enhance] Increase the closing event #1245