Closed papa-zulu closed 5 years ago
That's a feature we also like to have. It would be nice when this is merged soon.
Thanks for this @papa-zulu
Why a method? An event would have been more than enough here...
In my opinion, methods are a much cleaner solution than events.
Depends, this is usually a more of a React'ish pattern, than a Vue one. As you know in Vue the preferred way is events, unless you want to pass data from the function, but that is not the case.
Plus events can be debugged in the Vue devtools.
Just my two cents here.
@dobromir-hristov in your expectation it should be available like this: <vue-croppie v-on:croppieInitilaized="myFunction">
or <vue-croppie @croppieInitilaized="myFunction">
And after the component was initialized this.$emit('croppieInitilaized', something);
is called?
That looks actually better in my opinion, if it is working.
Correct, its the same behavior.
I am not saying the upper is wrong, just asked why it was done like that, if there was an intention or was it just preference. As we saw, it was preference, which is OK, as long as the library author is fine with it :)
@dobromir-hristov @immondu @papa-zulu I read your discussion. I agree that using a method is not wrong, however, an event would comply more on Vue's standards. Perhaps we could do another PR for this? Thank you all.
Changing it would cause a breaking change, not sure how many people use it now.
Or perhaps we could add an event counterpart then deprecate the method later?
Technically that is the proper way, but its funny because it has been out for what, 1 week? 😆
@dobromir-hristov I know! :laughing: :rofl:
The croppieInitilaized() method can be used to resolve the issue with server side rendering. https://github.com/jofftiquez/vue-croppie/issues/38
The passed method will fire when the croppie instance and reference are created.