svg-pan-zoom 3.6.1离线包

离线环境下搞前端开发,说实话,真得靠点“土办法”。像我用的<svg-pan-zoom>,就得手动整包、传包、解包,配置得清清楚楚才行。还好这个库挺轻便,配在vue3.2.47上也不卡。

svg-pan-zoom 的离线包,适合在内网或隔离环境里搞开发的同学。你只要把它下载下来,放到node_modules的根目录,在package.json里加一句:

"svg-pan-zoom": "^3.6.1"

这样就能愉快地用起来了。

用它干啥?比如你项目里有流程图、坐标图、平面图等要拖拽缩放交互的 SVG,直接配合ref一挂,响应也快,代码也简单:

import svgPanZoom from 'svg-pan-zoom';

onMounted(() => { svgPanZoom(document.getElementById('mySvg')); });

注意 SVG 得有id,不然找不到元素。

如果你跟我一样需要离线安装依赖,推荐你看看这些文章:

提醒一句:下载完的包记得解压后检查一下结构,要是少了distmain.js,项目跑不起来。你可以用package-deps-cli(看这篇)来列下依赖确认下。

如果你常在离线环境折腾前端,建议专门搞个“依赖收集器”目录,打好包,一次传一堆,省事儿。

zip
svg-pan-zoom.zip 预估大小:60个文件
folder
svg-pan-zoom 文件夹
file
.editorconfig 216B
file
gulpfile.js 2KB
file
svg-pan-zoom-logo.png 25KB
folder
src 文件夹
file
stand-alone.js 507B
file
control-icons.js 9KB
folder
media 文件夹
file
reset.ai 159KB
file
reset.svg 3KB
file
uniwheel.js 4KB
file
browserify.js 77B
file
svg-pan-zoom.js 25KB
file
shadow-viewport.js 9KB
file
utilities.js 8KB
file
svg-utilities.js 7KB
file
LICENSE 1KB
folder
tests 文件夹
file
test_api.js 15KB
folder
assets 文件夹
file
qunit.js 62KB
file
tiger.svg 67KB
file
jquery.min.js 94KB
file
qunit.css 4KB
file
blanket.js 186KB
file
index.html 2KB
file
test_typescript.ts 3KB
file
server.js 6KB
folder
demo 文件夹
file
multi-instance.html 341KB
file
inline-wide.html 72KB
file
inline-viewbox-zoomed.html 72KB
file
require-main.js 221B
file
inline.html 73KB
file
pathway.svg 32KB
file
object.html 648B
file
require.html 433B
file
dynamic-load.html 2KB
file
thumbnailViewer.js 7KB
file
simple-animation.html 2KB
file
resize.html 1KB
file
limit-pan.html 2KB
file
custom-event-handlers.html 3KB
file
sinchronized.html 2KB
file
mobile.html 4KB
file
img.html 668B
file
thumbnailViewer.html 2KB
file
layers.html 2KB
file
Tux.svg 219KB
file
embed.html 605B
file
hammer.js 66KB
file
custom-controls.html 1KB
file
tiger.svg 67KB
file
wikipathways.html 30KB
file
jquery.min.js 94KB
file
tslint.json 134B
file
svg-pan-zoom-logo.svg 10KB
folder
dist 文件夹
file
svg-pan-zoom.js 64KB
file
svg-pan-zoom.d.ts 6KB
file
svg-pan-zoom.min.js 29KB
file
package.json 2KB
file
ISSUE_TEMPLATE.md 1KB
file
.eslintrc.json 49B
file
index.html 1KB
file
tsconfig.json 403B
file
README.md 22KB
zip 文件大小:667.05KB