-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: runtime config #70
Conversation
I was thinking about opening a new PR solving this issue, updating the plugin configuration in runtime. Thanks @bason8800 for the approach, I hope it gets merged! |
Hope, this will be merged soon! |
To solve the problem with using multiple instances or versions of Google Recaptcha on the same page,I just discovered that if you need to change the plugin settings in runtime, you can do it updating plugin's object directly via The point is if you update the plugin's
By this way, each time you update plugin's I hope it helps as I have been struggling with this for almost a week. |
Thank you for this great PT @bason8800 Do you mind adding a note into the README to show how to use the publicRuntimeConfig too? |
@atinux done |
Thank you for the contribution @bason8800 Proposed by this PR: export default {
publicRuntimeConfig: {
recaptcha: {
siteKey: process.env.RECAPTCHA_SITE_KEY
}
}
} Current state: export default {
recaptcha: {
siteKey: process.env.RECAPTCHA_SITE_KEY
}
} |
Hi @farnabaz , with the @bason8800 change, we can use publicRuntimeConfig, to change the env var for sitekey without rebuild all project, but just launching the "npm start" command, we can have the var updated. The normal way, compile the env var in a bundle that nuxt use to start, with publicRuntimeConfig the var are read runtime with the start of the project. Thx |
Changes looks good, I added two small code suggestions |
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
@bason8800 Do you mind to resolve conflicts? (I don't have write permission of your repo) |
Thank you @bason8800 |
* Use PascalCase for component registration This allows both `<Recaptcha>` and `<recaptcha>` to be used in templates. Components that are registered in PascalCase can be used in templates with either PascalCase or kebab-case, whereas components registered in kebab-case can only be referenced in kebab-case. Some projects prefer to use PascalCase for component tags, so it's better for this plugin to make both options available. See https://vuejs.org/v2/guide/components-registration.html#Name-Casing * update plugin.js for global use * Moved script element error callback to within promise so that the error can be caught further up the stack * Reset ready state after error * docs: remove david badge * docs: add usage (#74) Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> * feat(multi-widget): render and verify multiple v2 widgets (#75) * feat(language): enable google auto detection (#72) Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> * fix: describe error within execute() (#40) Co-authored-by: Abdelhak Akermi <abdelhak@akermi.me> * feat: runtime config (#70) Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> Co-authored-by: Nikolay Baskov <baskov@adv.ru> * fix: remove badge on destroy (#76) * Apply suggestions from code review Co-authored-by: Simon Garner <simon.garner@madscience.co.nz> Co-authored-by: mvrlin <mvrlin@pm.me> Co-authored-by: lat1992 <lat1992@users.noreply.github.com> Co-authored-by: Owen Andrews <owen@owenandre.ws> Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> Co-authored-by: Red Bayoub <40964509+redbayoub@users.noreply.github.com> Co-authored-by: Abdelhak Akermi <abdelhak.akermi@gmail.com> Co-authored-by: Abdelhak Akermi <abdelhak@akermi.me> Co-authored-by: bason8800 <41577602+bason8800@users.noreply.github.com> Co-authored-by: Nikolay Baskov <baskov@adv.ru>
No description provided.