feat(edges): Use slot injection for custom edges

This commit is contained in:
Braks
2022-04-04 21:42:48 +02:00
parent 307917011a
commit 3f15983f3e
5 changed files with 40 additions and 57 deletions
@@ -47,11 +47,7 @@ export default {
:key="edge.id"
:selectable="typeof edge.selectable === 'undefined' ? store.elementsSelectable : edge.selectable"
:updatable="typeof edge.updatable === 'undefined' ? store.edgesUpdatable : edge.updatable"
>
<template #default="edgeProps">
<slot v-if="edge.type" :name="`edge-${edge.type}`" v-bind="edgeProps"></slot>
</template>
</EdgeWrapper>
/>
<ConnectionLine v-if="connectionLineVisible && sourceNode" :source-node="sourceNode" />
</g>
</svg>