fix(core): use computed for edge class and style

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-03-10 10:40:23 +01:00
committed by Braks
parent 0c286ac7b6
commit 5bd1eed98e
@@ -57,6 +57,9 @@ const EdgeWrapper = defineComponent({
const targetNode = $computed(() => findNode(edge.target))
const edgeClass = $computed(() => (edge.class instanceof Function ? edge.class(edge) : edge.class))
const edgeStyle = $computed(() => (edge.style instanceof Function ? edge.style(edge) : edge.style))
const { handlePointerDown } = useHandle({
nodeId,
handleId,
@@ -101,9 +104,6 @@ const EdgeWrapper = defineComponent({
targetPosition,
)
const edgeClass = edge.class instanceof Function ? edge.class(edge) : edge.class
const edgeStyle = edge.style instanceof Function ? edge.style(edge) : edge.style
return h(
'g',
{