@@ -33,14 +33,13 @@ npm i vue-stripe-js @stripe/stripe-js
3333``` vue
3434<script setup lang="ts">
3535import { onBeforeMount, ref } from "vue"
36- import { loadStripe } from "@stripe/stripe-js"
37- import type { Stripe } from "@stripe/stripe-js"
36+ import { loadStripe, type Stripe } from "@stripe/stripe-js"
3837
39- const publishableKey = ref('')
38+ const publishableKey = '' // use your publishable key
4039const stripe = ref<Stripe | null>(null)
4140
4241onBeforeMount(async() => {
43- stripe.value = await loadStripe(publishableKey.value )
42+ stripe.value = await loadStripe(publishableKey)
4443})
4544</script>
4645```
@@ -91,7 +90,7 @@ import type {
9190 StripePaymentElementOptions,
9291} from "@stripe/stripe-js"
9392
94- const stripeKey = ref( "pk_test_f3duw0VsAEM2TJFMtWQ90QAT")
93+ const stripeKey = "pk_test_f3duw0VsAEM2TJFMtWQ90QAT" // use your publishable key
9594const stripeOptions = ref({
9695 // https://stripe.com/docs/js/initializing#init_stripe_js-options
9796})
@@ -115,7 +114,7 @@ const elementsComponent = ref()
115114const paymentComponent = ref()
116115
117116onBeforeMount(() => {
118- loadStripe(stripeKey.value ).then(() => {
117+ loadStripe(stripeKey).then(() => {
119118 stripeLoaded.value = true
120119
121120 // Good place to call your backend to create PaymentIntent
0 commit comments