Skip to content

Commit 0476dff

Browse files
committed
fix(core,nodes): unwrap refs and pass props
Signed-off-by: braks <[email protected]>
1 parent 2543e16 commit 0476dff

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/core/src/components/Nodes/NodeWrapper.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ const NodeWrapper = defineComponent({
7373
},
7474
})
7575

76-
const getClass = computed(() => (node.class instanceof Function ? node.class(node) : node.class))
76+
const getClass = $computed(() => (node.class instanceof Function ? node.class(node) : node.class))
7777

78-
const getStyle = computed(() => {
78+
const getStyle = $computed(() => {
7979
const styles = (node.style instanceof Function ? node.style(node) : node.style) || {}
8080

8181
const width = node.width instanceof Function ? node.width(node) : node.width
@@ -88,7 +88,7 @@ const NodeWrapper = defineComponent({
8888
return styles
8989
})
9090

91-
const zIndex = computed(() => Number(node.zIndex ?? getStyle.value.zIndex ?? 0))
91+
const zIndex = computed(() => Number(node.zIndex ?? getStyle.zIndex ?? 0))
9292

9393
onUpdateNodeInternals((updateIds) => {
9494
if (updateIds.includes(props.id)) {
@@ -176,14 +176,14 @@ const NodeWrapper = defineComponent({
176176
`vue-flow__node-${props.type === false ? 'default' : props.name}`,
177177
{
178178
[noPanClassName]: props.draggable,
179-
dragging,
179+
dragging: dragging?.value,
180180
selected: node.selected,
181181
selectable: props.selectable,
182182
},
183183
getClass,
184184
],
185185
'style': {
186-
zIndex: node.computedPosition.z ?? zIndex,
186+
zIndex: node.computedPosition.z ?? zIndex.value,
187187
transform: `translate(${node.computedPosition.x}px,${node.computedPosition.y}px)`,
188188
pointerEvents: props.selectable || props.draggable ? 'all' : 'none',
189189
visibility: node.initialized ? 'visible' : 'hidden',
@@ -209,13 +209,13 @@ const NodeWrapper = defineComponent({
209209
events: { ...node.events, ...on },
210210
selected: !!node.selected,
211211
resizing: !!node.resizing,
212-
dragging,
212+
dragging: dragging?.value,
213213
connectable: props.connectable,
214214
position: node.position,
215215
dimensions: node.dimensions,
216216
isValidTargetPos: node.isValidTargetPos,
217217
isValidSourcePos: node.isValidSourcePos,
218-
parentNode: node.parentNode,
218+
parentFoo: node.parentNode,
219219
zIndex: node.computedPosition.z,
220220
targetPosition: node.targetPosition,
221221
sourcePosition: node.sourcePosition,

0 commit comments

Comments
 (0)