Skip to content

Commit 1619bfe

Browse files
author
Xavier ALUNDA
committed
Change VueJS template:
- Action is now a prop - Securing required props
1 parent f61db56 commit 1619bfe

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

vuejs/GoogleReCaptchaV3.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@
77
export default {
88
name: 'google-recaptcha-v3',
99
props: {
10-
siteKey: String,
11-
elementId: String,
12-
inline: Boolean
10+
siteKey: {
11+
type: String,
12+
required: true
13+
},
14+
elementId: {
15+
type: String,
16+
required: true
17+
},
18+
inline: {
19+
type: Boolean,
20+
default: false
21+
},
22+
action: {
23+
type: String,
24+
required: true
25+
}
1326
},
1427
data() {
1528
return {
@@ -42,9 +55,10 @@
4255
},
4356
methods: {
4457
execute() {
58+
let action = this.action;
4559
window.grecaptcha.ready(function () {
4660
grecaptcha.execute(this.gAssignedId, {
47-
action: 'contact_us'
61+
action: action
4862
});
4963
});
5064
},
@@ -72,4 +86,4 @@
7286
}
7387
}
7488
}
75-
</script>
89+
</script>

0 commit comments

Comments
 (0)