Open michaelsboost opened 2 months ago
I guess Vue 3 is not supported yet.
I am using panzoom
instead of vue-panzoom.
Install $ npm install --save @panzoom/panzoom
Import this as import Panzoom from '@panzoom/panzoom
in your vue component.
const instance = Panzoom(canvasElement, {
minScale: 1,
maxScale: 2,
contain: "outside",
// startX: -5000,
// startY: -5000,
});
canvasElement.addEventListener("wheel", instance.zoomWithWheel);
It works fine for me.
Note: Don't forget to remove the listener in unmounted
.
How can I use this with Vue 3 to test on codepen?