-
Notifications
You must be signed in to change notification settings - Fork 0
/
CodatConnections.vue
37 lines (32 loc) · 1.05 KB
/
CodatConnections.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script setup lang="ts">
import type { DisconnectCallbackArgs, ErrorCallbackArgs, ReconnectCallbackArgs } from 'https://connections-sdk.codat.io';
import { onMounted, ref } from 'vue';
const props = defineProps<{
accessToken: string
onDisconnect: (args: DisconnectCallbackArgs) => void
onReconnect: (args: ReconnectCallbackArgs) => void
onError: (args: ErrorCallbackArgs) => void
onClose: () => void
}>()
const target = ref()
onMounted(() => {
if (target.value && target.value.children.length === 0) {
import('https://connections-sdk.codat.io').then(({ CodatConnections }) => {
new CodatConnections({
target: target.value,
props: {
accessToken: props.accessToken,
onDisconnect: props.onDisconnect,
onReconnect: props.onReconnect,
onClose: props.onClose,
onError: props.onError
}
})
})
}
})
</script>
<template>
<!-- Inline styles suggest recommended dimensions -->
<div style="width: 460px; height: 840px; max-height: 95%;" ref="target"></div>
</template>