feat: Add slots to edges and nodes

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-18 03:19:13 +01:00
parent f22a3baa90
commit 8b82c4fb33
8 changed files with 70 additions and 50 deletions
+4 -2
View File
@@ -23,7 +23,9 @@ export default {
</script>
<template>
<Handle type="target" :position="props.targetPosition" :is-connectable="props.connectable" />
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
<slot>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
</slot>
<Handle type="source" :position="props.sourcePosition" :is-connectable="props.connectable" />
</template>
+4 -2
View File
@@ -20,7 +20,9 @@ export default {
}
</script>
<template>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
<slot>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
</slot>
<Handle type="source" :position="props.sourcePosition" :connectable="props.connectable" />
</template>
+4 -2
View File
@@ -20,7 +20,9 @@ export default {
}
</script>
<template>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
<slot>
<component :is="props.data?.label" v-if="typeof props.data?.label !== 'string'" />
<span v-else v-html="props.data?.label"></span>
</slot>
<Handle type="source" :position="props.targetPosition" :is-connectable="props.connectable" />
</template>