fix(edges): pass edge styles to edge path
This commit is contained in:
@@ -181,7 +181,7 @@ const Wrapper = defineComponent({
|
|||||||
labelBgBorderRadius: edge.labelBgBorderRadius,
|
labelBgBorderRadius: edge.labelBgBorderRadius,
|
||||||
data: edge.data,
|
data: edge.data,
|
||||||
events: { ...edge.events, ...hooks.on },
|
events: { ...edge.events, ...hooks.on },
|
||||||
style: edge.style,
|
style: (edge.style instanceof Function ? edge.style(edge) : edge.style) || {},
|
||||||
markerStart: `url(#${getMarkerId(edge.markerStart)})`,
|
markerStart: `url(#${getMarkerId(edge.markerStart)})`,
|
||||||
markerEnd: `url(#${getMarkerId(edge.markerEnd)})`,
|
markerEnd: `url(#${getMarkerId(edge.markerEnd)})`,
|
||||||
sourcePosition,
|
sourcePosition,
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ const getClass = (edge: GraphEdge) => {
|
|||||||
const extraClass = edge.class instanceof Function ? edge.class(edge) : edge.class
|
const extraClass = edge.class instanceof Function ? edge.class(edge) : edge.class
|
||||||
return [noPanClassName, extraClass]
|
return [noPanClassName, extraClass]
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStyle = (edge: GraphEdge) => (edge.style instanceof Function ? edge.style(edge) : edge.style) as CSSProperties
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -143,7 +141,6 @@ export default {
|
|||||||
:target-node="getNode(edge.target)"
|
:target-node="getNode(edge.target)"
|
||||||
:selectable="selectable(edge.selectable)"
|
:selectable="selectable(edge.selectable)"
|
||||||
:updatable="updatable(edge.updatable)"
|
:updatable="updatable(edge.updatable)"
|
||||||
:style="getStyle(edge)"
|
|
||||||
:class="getClass(edge)"
|
:class="getClass(edge)"
|
||||||
/>
|
/>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
Reference in New Issue
Block a user