vue-photoswipe-mobile
Version:
A mobile picture preview plugin based on photoswipe and vue 基于vue和photoswipe的移动端图片查看器
17 lines (15 loc) • 469 B
JavaScript
import Vue from 'vue'
import PreviewComponent from './previewer.vue'
var instance
PreviewComponent.open = function (index, list, params) {
if (!instance) {
var PreviewConstruct = Vue.extend(PreviewComponent)
instance = new PreviewConstruct({ el: document.createElement('div') })
document.body.appendChild(instance.$el)
}
instance.open(index, list, params)
}
PreviewComponent.close = function () {
instance.close()
}
export default PreviewComponent