jarvisniu / vue-zoomer

Zoom the image or other thing with mouse or touch
MIT License
150 stars 37 forks source link

[FEATURE REQUEST] Expose reset transform/translate trigger in v-zoomer-gallery #1

Closed CesarGomezTissini closed 5 years ago

CesarGomezTissini commented 5 years ago

Some situation when we use vue-zoomer from a Dialog (v-dialog from Vuetify), it's necessary reset transform/translate values in zoomed image. I know there is a zoomed event, but this is not enough.

According your code, there is too a trigger to reset transform/translate zoomed image. I wanna use when I press close in dialog.

jarvisniu commented 5 years ago

Oh, there is also a reset() method. Are you looking for this?

CesarGomezTissini commented 5 years ago
<v-zoomer-gallery
     ref="galleryZoom"
     v-model="selIndex"
     style="width: 80vw; height: 400px"
     :list="gallery">
</v-zoomer-gallery>
this.$refs.galleryZoom.reset()

Error in v-on handler: "TypeError: this.$refs.galleryZoom.reset is not a function"

That's why my proposal. v-zoomer-gallery doesn't have that method.

jarvisniu commented 5 years ago

Sorry for misunderstanding it. I have added the reset method to v-zoomer-gallery. Please update to the newest v0.2.9 version.