update(edges): useAttrs on edges to use style

* remove class and style props, pass them as attrs

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-21 13:33:59 +01:00
parent e4ead738c9
commit ba24f3ca62
7 changed files with 45 additions and 31 deletions
+5
View File
@@ -31,6 +31,11 @@ const edgePath = computed(() =>
)
const markerEnd = computed(() => getMarkerEnd(props.arrowHeadType, props.markerEndId))
</script>
<script lang="ts">
export default {
inheritAttrs: false,
}
</script>
<template>
<path :id="props.id" class="vue-flow__edge-path" :d="edgePath" :marker-end="markerEnd" />
<text>
+8 -1
View File
@@ -16,7 +16,9 @@ interface CustomEdgeProps extends EdgeProps {
targetPosition: Position
arrowHeadType?: ArrowHeadType
markerEndId?: string
data?: any
data?: {
text: string
}
}
const props = defineProps<CustomEdgeProps>()
@@ -41,6 +43,11 @@ const center = computed(() =>
}),
)
</script>
<script lang="ts">
export default {
inheritAttrs: false,
}
</script>
<template>
<path :id="props.id" class="vue-flow__edge-path" :d="edgePath" :marker-end="markerEnd" />
<EdgeText
+1 -1
View File
@@ -40,7 +40,7 @@ const initialElements: Elements = [
source: '5',
target: '6',
label: {
component: CustomLabel,
component: markRaw(CustomLabel),
props: {
text: 'custom label text',
},