overtrue/vue-avatar-cropper

A better way to trigger the avatar cropper

ferretwithaberet opened this issue · 2 comments

At the moment, an addEventListener is used to catch the click event on the element determined from the trigger css selector.

My ideea is to have a boolean prop with v-model and a default value of false, which when changed to true will trigger the component, when the component closes the boolean will be set back to false. This will allow the user of this package to trigger the component in more ways than it is currently available, not only by clicking on an element.

Feel free to propose any other ideas to achieve this result. The whole point of this issue is to brainstorm ways of doing this to achieve the best outcome, I will start working on this feature soon and it might release as v3.0.0.

@overtrue when you have some time, please test the improved-trigger branch.

Edit: I tested it and it seems to work as supposed, until you review that implementation I will think about better, more intuitive ways we could achieve the same outcome.

@ferretwithaberet Thanks for your contribution, I've just tested it and I think it's a pretty good solution.