Vue - 使用图片放大镜插件 vue-piczoom

2022-06-18 10:55:33

vue-piczoom:https://www.npmjs.com/package/vue-piczoom/v/1.0.6

使用图片放大镜插件 vue-piczoom

1. 安装

npm install vue-piczoom --save

2. 使用

<template><divclass="wrap"><!-- 组件默认是100%的高宽,所以建议将组件包含在一个有固定高宽的容器内 --><divstyle="width: 500px;height: 500px"><!-- 第三步:标签使用 --><pic-zoomurl="/static/img/1.jpg":scale="3"></pic-zoom></div></div></template><script>// 第一步:引入vue-piczoomimport PicZoomfrom"vue-piczoom";exportdefault{// 第二部:注册组件
  components:{
    PicZoom,},data(){return{};},};</script><stylescoped></style>

3. Config 配置

参数说明默认值
url图片地址string required
big-url大图地址string null
scale图片放大倍数number 2.5
scroll放大时页面是否可滚动boolean fasle
show-edit是否显示旋转图片按钮boolean fasle
  • 作者:Jie_1997
  • 原文链接:https://blog.csdn.net/Jie_1997/article/details/109332140
    更新时间:2022-06-18 10:55:33