You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,6 +112,15 @@ Component appends captcha script into head section of application. If you alread
112
112
</template>
113
113
```
114
114
115
+
> Package checks if `window.smartCaptcha` object was defined. However when using multiple captcha instances at once all of them will have `window.smartCaptcha === undefined` on initial load. Therefore it is better either load script on your own and disable widget loading for every captcha or disable it for every captcha but first, e.g.
116
+
117
+
```vue
118
+
<template>
119
+
<SmartCaptcha />
120
+
<SmartCaptcha :load-widget="false" />
121
+
</template>
122
+
```
123
+
115
124
### Rendering timeout
116
125
117
126
On a mount component will try to resolve global `window.smartCaptcha` object. If it was not defined component will "die". You may set `timeout` property in milliseconds to specify amount of time package will try to resolve this object
> Package checks if `window.smartCaptcha` object was defined. However when using multiple captcha instances at once all of them will have `window.smartCaptcha === undefined` on initial load.. Therefore it is better either load script on your own and disable widget loading for every captcha or disable it for every captcha but first, e.g.
263
+
264
+
```js
265
+
constfirstCaptcha=useSmartCaptcha(container, {
266
+
// render props
267
+
})
268
+
269
+
constsecondCaptcha=useSmartCaptcha(container, {
270
+
// render props
271
+
}, false) // disable script appending as it will be appended by first captcha
272
+
```
273
+
253
274
### Rendering timeout
254
275
255
276
When being called composable will try to resolve global `window.smartCaptcha` object. If it was not defined component will "die". You may set `timeout` as fourth argument in milliseconds to specify amount of time package will try to resolve this object
Package provides utility class with every method but `render` in order if you need call captcha methods "manually" outside of current captcha (since both composable and captcha do not allows you to specify "custom" widget id)
0 commit comments