npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-magnifier-ting

v2.1.3

Published

基于vue, 放大镜,鼠标或按钮缩放组件,并可标记定点功能

Downloads

23

Readme

vue-magnifier-ting

基于 vue, 包含放大镜,鼠标或按钮缩放组件,并可标记定点功能

Build Setup

# install dependencies
npm install vue-magnifier-ting

# 项目启动
npm run dev

node >= 14.15.0

用法

Attributes

| 属性 | 说明 | 类型 | 默认值 | | :----------------------- | :------------------------------------------- | :-----------: | :----------------------: | | isGlass | 是否启用放大镜效果,默认为滚动放大缩小组件 | boolean | false | | imgUrl | 图片地址,必填 | string | -- | | width | 可视区域容器的宽度 | number/string | 100% | | height | 可视区域容器的高度 | number/string | 100% | | -- | 以下属性均为 isGlass: true 的情况下配置生效 | | glassOption | 放大镜的参数 | Object | { width, height: scale } | | glassOption.width | 鼠标右侧放大镜的宽度 | number | 150 | | glassOption.height | 鼠标右侧放大镜的高度 | number | 150 | | glassOption.scale | 放大比例 | number | 2 | | -- | 以下属性均为 isGlass: false 的情况下配置生效 | | isNeedPoint | 是否需要添加标记点 | boolean | false | | spots | 标记点信息 | array | [] | | spots[i].left | 标记点的 left 定位信息 | number | -- | | spots[i].top | 标记点的 top 定位信息 | number | -- | | spots[i].iconUrl | 标记点的 icon 地址 | string | 默认图片 | | spots[i].title | 标记点的标题 | string | -- | | scaleOption | 放大缩小参数 | Object | {} | | scaleOption.isMousewheel | 是否鼠标滚动放大缩小 | boolean | true | | scaleOption.maxScale | 放大的最大倍数 | number | 10 | | scaleOption.minScale | 缩小的最小倍数 | number | 0.5 |

Methods,isGlass: false 的情况下配置生效

| 方法名 | 说明 | 参数 | | :----------- | :----------------- | :--------------------------------------------------------------------------------------- | | handleZoom | 缩放图片方法 | (type, scale) type 类型为 enlarged(放大)或者 reduce(缩小), scale,缩放比例,默认 0.2 | | handleRotate | 旋转图片方法 | -- | | handleRest | 图片还原为初始状态 | -- |

Events,isGlass: false 的情况下配置生效

| 事件名称 | 说明 | 回调参数 | | :------------- | :--------------- | :------------------------------------------------ | | click-point | 点击标记点 | 传递给 spots 属性的数组中,该标记节点所对应的对象 | | dblclick-point | 双击图中任意位子 | { top, left } 图片标记点的定位 |

源码

https://gitee.com/Tina_yu/vue-magnifier-ting