Skip to content

Commit

Permalink
use templateRef
Browse files Browse the repository at this point in the history
  • Loading branch information
aggre committed Dec 19, 2024
1 parent 7814cf6 commit 94efab0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/TransactionForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, useTemplateRef } from 'vue'
import type { Failure, Success } from './api/payment-key'
import type { ComposedItem } from './types'
import { whenDefined, whenDefinedAll, whenNotError } from '@devprotocol/util-ts'
Expand Down Expand Up @@ -98,7 +98,7 @@ const customerEmail = ref<string | undefined>(undefined)
const customerName = ref<string | undefined>(undefined)
const loading = ref(false)
const error = ref<string | undefined>(undefined)
const component = ref<Element | undefined>(undefined)
const component = useTemplateRef('component')
const waitingForMinted = ref(false)
const i18nBase = i18nFactory(Strings)
const i18n = ref(i18nBase(['en']))
Expand Down Expand Up @@ -245,6 +245,8 @@ const clickHandler = async () => {
waitingForMinted.value = false
console.log('component.value', component.value)
return result instanceof Error
? onError(result.message)
: component.value?.dispatchEvent(
Expand Down

0 comments on commit 94efab0

Please sign in to comment.