<BaseEdge />
The <BaseEdge /> component is used internally by all the built-in edges. It can be
used inside a custom edge and handles the
invisible interaction path and the edge label for you.
<!-- CustomEdge.vue -->
<script setup lang="ts">
import { BaseEdge, getStraightPath, type EdgeProps } from '@xyflow/vue';
import { computed } from 'vue';
const props = defineProps<EdgeProps>();
const path = computed(() => getStraightPath({
sourceX: props.sourceX,
sourceY: props.sourceY,
targetX: props.targetX,
targetY: props.targetY,
}));
</script>
<template>
<BaseEdge :id="id" :path="path[0]" />
</template>Props
The type for props of <BaseEdge /> component is exported as BaseEdgeProps.
Notes
- If you want to use a marker, pass the marker id to the
markerStartormarkerEndprops — the same values you’d set on an edge’smarkerStart/markerEnd.