This article mainly introduces the use of the e-commerce picture magnifying glass plug-in based on vue2.x. Now I will share it with you and give you a reference.
Recently I was working on an e-commerce website. There was a need to put the mouse on the main image to display the image magnifying glass effect like Taobao product details page. After searching, it seemed that there was no suitable vue plug-in, so I masturbated one myself and wanted to share it. It's Xiaobai's first time to share, and all the masters should not laugh.
vue-piczoom
picture magnifier component for Vue.js 2.x
E-commerce picture magnifier plug-in based on vue2.x
GIF animated screenshot
##Build Setup usage steps
# 安装 install npm install vue-piczoom --save
import PicZoom from 'vue-piczoom' export default { name: 'App', components: { PicZoom } }
<pic-zoom url="static/imac2.jpg" :scale="3"></pic-zoom>
Config configuration
describe | default | |
---|---|---|
Picture address | string required | |
Big picture address | string null | |
Picture magnification | number 2.5 | |
Whether the page can be scrolled when zoomed in | boolean fasle |
The component defaults to 100% height and width, so it is recommended to include the component in a container with fixed height and width. For example:
<pic-zoom url="static/imac2.jpg" :scale="3"></pic-zoom>
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to achieve forward refresh and backward non-refresh effect in vueIn Vue2.5 through Table and How does the Pagination component implement the paging functionHow to integrate Bootstrap 4 in Laravel? How to get the option value in the select tag in jqueryHow to dynamically add option to select using js (detailed tutorial)Connecting to MySQL in nodejs (detailed tutorial)How to achieve seamless scrolling effect using vue.jsUse routing in vue to implement page refreshjQuery implements recursive infinite layer functionThe above is the detailed content of How to use the picture magnifying glass plug-in in vue2.x?. For more information, please follow other related articles on the PHP Chinese website!