advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

unable to use setCoordinates method #181

Closed giedriusStan closed 2 years ago

giedriusStan commented 2 years ago

I have never worked with vue before and probably I'm just using the app wrong, but if I try to execute setCoordinates function, I get an error "Uncaught TypeError: Cannot read properties of undefined (reading 'setCoordinates')". This is my code:

https://jsfiddle.net/8hqs9fyj/

is this a bug, or am I missing something?

Norserium commented 2 years ago

@giedriusStan, you didn't set the ref property at the cropper. The fixed example.

But, frankly, you have a lot of strange things here. What do you want to make?

giedriusStan commented 2 years ago

Thank you! This is it! This jsfiddle was taken from documentation page here https://norserium.github.io/vue-advanced-cropper/introduction/getting-started.html#using-cdn I just added the resize part

Norserium commented 2 years ago

I just added the resize part

@giedriusStan, if you want to set the default coordinates it's recommended to use default-position and default-size properties. Also, if you indeed want to create the resizing method, I assume it shouldn't be the global application method.