diff --git a/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue b/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue index 157fbf47..6fcc75ae 100644 --- a/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue +++ b/examples/vite/src/NodeTypeChange/NodeTypeChangeExample.vue @@ -31,7 +31,9 @@ onPaneReady((instance) => instance.fitView()) function changeType() { elements.value.forEach((el) => { - if (isEdge(el) || el.type === 'input') return + if (isEdge(el) || el.type === 'input') { + return + } el.type = el.type === 'default' ? 'output' : 'default' }) } diff --git a/examples/vite/src/Overview/Overview.vue b/examples/vite/src/Overview/Overview.vue index 41790213..46ad7127 100644 --- a/examples/vite/src/Overview/Overview.vue +++ b/examples/vite/src/Overview/Overview.vue @@ -120,16 +120,26 @@ const initialElements: Elements = [ const snapGrid: SnapGrid = [16, 16] function nodeStrokeColor(n: Node): string { - if ((n.style as Styles)?.background) return (n.style as Styles).background as string - if (n.type === 'input') return '#0041d0' - if (n.type === 'output') return '#ff0072' - if (n.type === 'default') return '#1a192b' + if ((n.style as Styles)?.background) { + return (n.style as Styles).background as string + } + if (n.type === 'input') { + return '#0041d0' + } + if (n.type === 'output') { + return '#ff0072' + } + if (n.type === 'default') { + return '#1a192b' + } return '#eee' } function nodeColor(n: Node): string { - if ((n.style as Styles)?.background) return (n.style as Styles).background as string + if ((n.style as Styles)?.background) { + return (n.style as Styles).background as string + } return '#fff' } diff --git a/examples/vite/src/SnapHandle/SnappableConnectionLine.vue b/examples/vite/src/SnapHandle/SnappableConnectionLine.vue index c6eecc96..0a712afa 100644 --- a/examples/vite/src/SnapHandle/SnappableConnectionLine.vue +++ b/examples/vite/src/SnapHandle/SnappableConnectionLine.vue @@ -59,7 +59,9 @@ watch([() => props.targetY, () => props.targetX], (_, __, onCleanup) => { }, ) - if (!closestNode.node) return + if (!closestNode.node) { + return + } canSnap.value = closestNode.distance < SNAP_DISTANCE