vc-popup-img-viewer
vc-popup-img-viewer
模仿微信的图片浏览器~
添加依赖
> yarn add vc-popup-img-viewer || npm i vc-popup-img-viewer || cnpm i vc-popup-img-viewer --by=yarn
引入
import Vue from 'vue'
import VcPopupImgViewer from 'vc-popup-img-viewer'
// 这里名字可以随意
Vue.use(VcPopupImgViewer)
在具体页面中使用
this.imgViewer = new this.$popup.ImgViewer({
...config
propsData: {}
})
this.imgViewer.open(e, {
...config
propsData: {}
})
this.imgViewer.close()
e为事件Event, 比如click时候取得的evt, 与一些定位方法相关 config可参考popup-base/readme.md
propsData配置定义
{
e: Object // 从open(e, {})传进来的e
imgs: { // img标签的数组
type: [Array, HTMLCollection],
required: true
},
loop: { // 是否允许循环滑动
type: Boolean,
default: false
},
gap: { // 图片之间的间隙
type: Number,
default: 16
}
}
效果预览
License
MIT 一起来扣细节~
Related Packages
vue-img-tag
A simple vue2 component, just for img preview, can be used to file input preview...
1,310
4
@diracleo/vue-enlargeable-image
A Vue component that, when clicked, will enlarge an image from thumbnail to full...
5,506
14
Version History
| Version | Released | License |
|---|---|---|
| 0.1.26 | MIT | |
| 0.1.25 | MIT | |
| 0.1.24 | MIT | |
| 0.1.23 | MIT | |
| 0.1.22 | MIT | |
| 0.1.21 | MIT | |
| 0.1.20 | MIT | |
| 0.1.19 | MIT | |
| 0.1.18 | MIT | |
| 0.1.17 | MIT | |
| 0.1.16 | MIT | |
| 0.1.15 | MIT | |
| 0.1.14 | MIT | |
| 0.1.13 | MIT | |
| 0.1.12 | MIT | |
| 0.1.11 | MIT | |
| 0.1.10 | MIT | |
| 0.1.9 | MIT | |
| 0.1.8 | MIT | |
| 0.1.6 | MIT | |
| 0.1.5 | MIT | |
| 0.1.4 | MIT | |
| 0.1.3 | MIT | |
| 0.1.2 | MIT | |
| 0.1.1 | MIT | |
| 0.1.0 | MIT | |
| 0.0.13 | MIT | |
| 0.0.8 | MIT | |
| 0.0.6 | MIT | |
| 0.0.5 | MIT |
Showing the latest 30 of 32. See every release on npm
Pre-releases (4)
| Version | Released | License |
|---|---|---|
| 0.1.0-alpha-2 | MIT | |
| 0.1.0-3 | MIT | |
| 0.1.0-2 | MIT | |
| 0.1.0-0 | MIT |