diff --git a/README.md b/README.md index dac8914..a0701c5 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,17 @@ export default defineComponent({ }) }) + const = pay () => { + // Get stripe element + const cardElement = card.stripeElement + + // Access instance methods, e.g. createToken() + elms.instance.createToken(cardElement).then((result: object) => { + // Handle result.error or result.token + console.log(result) + }) + }, + return { stripeKey, stripeLoaded, @@ -112,21 +123,9 @@ export default defineComponent({ cardOptions, card, elms, + pay } }, - - methods: { - pay() { - // Get stripe element - const cardElement = this.card.stripeElement - - // Access instance methods, e.g. createToken() - this.elms.instance.createToken(cardElement).then((result: object) => { - // Handle result.error or result.token - console.log(result) - }) - }, - }, })