vue-recaptcha
Version:
ReCAPTCHA vue component
32 lines (31 loc) • 922 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createUnheadRecaptcha = void 0;
var _vue = require("@unhead/vue");
var _common = require("./common.cjs");
const createUnheadRecaptcha = (0, _common.defineScriptLoader)(options => {
return () => {
(0, _vue.useHead)({
link: [{
key: "vue-recaptcha-google",
rel: "preconnect",
href: options.useRecaptchaNet ? "https://www.recaptcha.net" : "https://www.google.com"
}, {
key: "vue-recaptcha-gstatic",
rel: "preconnect",
href: "https://www.gstatic.com",
crossorigin: ""
}],
script: [{
key: "vue-recaptcha",
src: `${options.recaptchaApiURL}?${(0, _common.toQueryString)(options.params)}`,
async: true,
defer: true,
nonce: options.nonce
}]
});
};
});
exports.createUnheadRecaptcha = createUnheadRecaptcha;
;