演示https://826327700.github.io/vue-piczoom/dist/
1.安装
npm install vue-piczoom --save
2. 使用
<template>
<div class="wrap">
<!-- 组件默认是100%的高宽,所以建议将组件包含在一个有固定高宽的容器内 -->
<div style="width: 500px; height: 500px">
<!-- 第三步:标签使用 -->
<!-- :scale 当属性被v-bind修饰时 里面内容为js :scale ="3" 3是数字类型
scale ="3" 3是字符串类型 -->
<pic-zoom url="https://static01.imgkr.com/temp/bd2fb06a0a8f4576bcc6d19841de1533.jpg"
:scale="3"></pic-zoom>
</div>
</div>
</template>
<script>
// 第一步:引入vue-piczoom
import PicZoom from "vue-piczoom";
export default {
// 第二部:注册组件
components: {
PicZoom,
},
data() {
return {};
},
};
</script>
<style scoped>
</style>
- Config 配置
| 参数 Parameters | 说明 Account for | 默认值Default value |
|---|---|---|
| url | 图片地址 Photo address | string required |
| big-url | 大图地址 Big Map address | string null |
| scale | 图片放大倍数 Image Magnification | number 2.5 |
| scroll | 放大时页面是否可滚动 | boolean fasle |
| show-edit | 是否显示旋转图片按钮 Whether to display the rotate picture button | boolean fasle |
版权声明:本文为LYGCSDN_原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。