-
Notifications
You must be signed in to change notification settings - Fork 40
vue refactor (remove interval loading, fix prop definitions and use $ref and $emit event) #21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
…als anymore) - Made it possible to bind the response token to a model, the Vue way. <google-recaptcha-v3 v-model="yourDataAttribute"></google-recaptcha-v3> - Made all props optional with default values that can be configured on the component
Wowow!!! I was planning to refactor it as well. Wow! I will check it tonight as soon as possible. |
Hello @Fluxlicious , I have played it a bit around with the proposed approach, I am unable to render multiple recaptcha on the same page e.g. (probably I am doing something wrong)
errors: Yeah, I might need to look into it deeply this weekend and also adding some unit tests later for the vue component later this week. I really appreciate the work you have done! The proposed approach is good, I need to ensure some edge cases to be verified as well, I will get back to you soon. Will be no later this week :) |
No you're right, didn't check that. Also having multiple recaptcha tried to load the script more than once as while the script wasn't loaded yet. Fixed it in commit f97251d by identifying the presence of the script tag and while the script is still loading push the render callbacks to an array and execute them all once the script is loaded. |
@Fluxlicious Sorry for the late reply. I am looking into it now. |
good good, also I learnt some from your approach. 👍 |
I have sent a contributor inv to you, feel free if you want to accept the invitation. 🥇 |
Awesome refactoring @Fluxlicious !
|
Upgrade warning: this upgrade breaks functionality. Prop changed from
elementId
toid
. Adjust your code accordingly.Note: when using model binding you need to call execute() after each request to get a new token.
In your template:
In your script: