chore(core): cleanup

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-05-25 20:48:26 +02:00
committed by Braks
parent 26943b2d85
commit ff9f6471ed
3 changed files with 5 additions and 8 deletions
@@ -1,10 +1,7 @@
<script lang="ts" setup>
import { toRef } from '@vueuse/core'
import { useVueFlow } from '../../composables'
const { viewportRef } = useVueFlow()
const teleportTarget = toRef(() => viewportRef.value?.getElementsByClassName('vue-flow__edge-labels')[0])
</script>
<script lang="ts">
@@ -17,7 +14,7 @@ export default {
<template>
<svg>
<foreignObject height="0" width="0">
<Teleport :to="teleportTarget as any" :disabled="!teleportTarget">
<Teleport :to="viewportRef!.getElementsByClassName('vue-flow__edge-labels')[0] as any" :disabled="!teleportTarget">
<slot />
</Teleport>
</foreignObject>
@@ -1,5 +1,5 @@
import { computed, defineComponent, h, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
import { toRef, until, useVModel } from '@vueuse/core'
import { until, useVModel } from '@vueuse/core'
import type { GraphNode, HandleConnectable, NodeComponent } from '~/types'
import { NodeId, NodeRef } from '~/context'
import { isInputDOMNode, useDrag, useNodeHooks, useUpdateNodePositions, useVueFlow } from '~/composables'
@@ -60,7 +60,7 @@ const NodeWrapper = defineComponent({
const node = useVModel(props, 'node')
const parentNode = toRef(() => findNode(node.value.parentNode))
const parentNode = computed(() => findNode(node.value.parentNode))
const connectedEdges = computed(() => getConnectedEdges([node.value], edges.value))