img-pre

img标签上的图片放大预览指令.

Usage no npm install needed!

<script type="module">
  import imgPre from 'https://cdn.skypack.dev/img-pre';
</script>

README

图片点击放大查看功能

适用范围:

  • vue项目
  • img标签上使用

使用示例:

设置

// main.js
import Vue from 'vue'
import imgPre from 'img-pre'

Vue.use(imgPre)

使用

// test.vue
<template>
    <img class="img" v-img-pre src="@/assets/demo_images/test.jpg" alt="刺激" />
</template>

更新记录

2021-4-1

首次上传;

修改包名称为img-pre;

图片预览功能升级,保留一点上下间距,可旋转。