vue-preview App查看大图

原文链接: https://github.com/LS1231/vue-preview

1.安装  

npm i vue-preview -S

2.在main.js文件中导入该组件,并挂载

import VuePreview from 'vue-preview';
Vue.use(VuePreview);

//或

Vue.use(preview, {
  mainClass: 'pswp--minimal--dark',
  barsSize: {top: 0, bottom: 0},
  captionEl: false,
  fullscreenEl: false,
  shareEl: false,
  bgOpacity: 0.85,
  tapToClose: true,
  tapToToggleControls: false
})

3.使用



Property Description
src main (large) image
msrc small image
alt image replacement text
w image width
h image height

4.效果图 

vue-preview App查看大图_第1张图片

 

你可能感兴趣的:(Vue,vue常用插件)