Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 验证码小部件不断消失(启动验证码p-Captcha)_Typescript_Spring Boot_Angular6_Primeng - Fatal编程技术网

Typescript 验证码小部件不断消失(启动验证码p-Captcha)

Typescript 验证码小部件不断消失(启动验证码p-Captcha),typescript,spring-boot,angular6,primeng,Typescript,Spring Boot,Angular6,Primeng,我正在为我的应用程序使用启动验证码。当我通过其他页面路由页面时,它工作正常。但是当我直接加载页面时,验证码不会显示(有时它会显示grecaptcha.render不是控制台中的函数) 如primefaces中所述,我已在index.html中添加了脚本() 另外,我在some-component.html中添加了这个() 我试图显式地呈现它。但还是没有运气。有人能帮我一个例子onLoad函数和在哪里实现。它是否应该在index.html脚本或其他地方实现 index.html <!doct

我正在为我的应用程序使用启动验证码。当我通过其他页面路由页面时,它工作正常。但是当我直接加载页面时,验证码不会显示(有时它会显示grecaptcha.render不是控制台中的函数)

如primefaces中所述,我已在index.html中添加了脚本(

另外,我在some-component.html中添加了这个(

我试图显式地呈现它。但还是没有运气。有人能帮我一个例子onLoad函数和在哪里实现。它是否应该在index.html脚本或其他地方实现

index.html

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Title</title> <base href="/"> <script src="https://www.google.com/recaptcha/api.js?render=explicit&onLoad=initRecaptcha" async defer></script> </head> <body> <app-root></app-root> </body> </html>

让我看看你能更新你问题中的代码吗?不在评论中。让我知道你的启动版本?是否为8.1.1 PRIMENG版本-7.1.0
<div class="p-col-11"> <p-captcha id="captcha" siteKey="sitekey" (onResponse)="storeRecaptchaResponse($event)" #captcha></p-captcha> </div>
storeRecaptchaResponse(event) { this.recaptchaSubmitted = true; this.recaptchaResponse = event.response; console.log('Captcha Response ' + this.recaptchaResponse); }