@abc3971139/imgpre

VUE 图片预览 打印插件

Usage no npm install needed!

<script type="module">
  import abc3971139Imgpre from 'https://cdn.skypack.dev/@abc3971139/imgpre';
</script>

README

Vue 图片预览插件

安装

  npm i @abc3971139/imgpre -S

main.js 里引入

  import imgPre from "@abc3971139/imgpre";
  import "@abc3971139/imgpre/dist/imgPre.css"; 

挂载 Vue 原型链

  Vue.prototype.$imgPre = imgPre;

页面中使用

  this.$imgPre(options);

options说明

  {
    imgList: Array, // 展示的图片数组
    index: Number, // 当前展示图片的下标
    showPrint: true // 是否需要打印
  }