fix: missing node id in node components/slots
This commit is contained in:
@@ -36,7 +36,7 @@ const initialElements: Elements = [
|
|||||||
position: { x: 400, y: 100 },
|
position: { x: 400, y: 100 },
|
||||||
style: { background: '#D6D5E6', color: '#333', border: '1px solid #222138', width: 180 },
|
style: { background: '#D6D5E6', color: '#333', border: '1px solid #222138', width: 180 },
|
||||||
},
|
},
|
||||||
{ id: 'e1-2', source: '1', target: '2', label: 'This is a draggable edge' },
|
{ id: 'e1-2', source: '1', target: '2', label: 'Updateable edge' },
|
||||||
] as Elements
|
] as Elements
|
||||||
|
|
||||||
const elements = ref(initialElements)
|
const elements = ref(initialElements)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Handle from '~/components/Handle/Handle.vue'
|
import Handle from '~/components/Handle/Handle.vue'
|
||||||
import { NodeProps, Position } from '~/types'
|
import { NodeProps, Position } from '~/types'
|
||||||
|
|
||||||
interface DefaultNodeProps {
|
interface DefaultNodeProps extends NodeProps {
|
||||||
data?: NodeProps['data']
|
data?: NodeProps['data']
|
||||||
connectable?: NodeProps['connectable']
|
connectable?: NodeProps['connectable']
|
||||||
targetPosition?: NodeProps['targetPosition']
|
targetPosition?: NodeProps['targetPosition']
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Handle from '~/components/Handle/Handle.vue'
|
import Handle from '~/components/Handle/Handle.vue'
|
||||||
import { NodeProps, Position } from '~/types'
|
import { NodeProps, Position } from '~/types'
|
||||||
|
|
||||||
interface InputNodeProps {
|
interface InputNodeProps extends NodeProps {
|
||||||
data?: NodeProps['data']
|
data?: NodeProps['data']
|
||||||
connectable?: NodeProps['connectable']
|
connectable?: NodeProps['connectable']
|
||||||
sourcePosition?: NodeProps['sourcePosition']
|
sourcePosition?: NodeProps['sourcePosition']
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ watch(
|
|||||||
>
|
>
|
||||||
<slot
|
<slot
|
||||||
v-bind="{
|
v-bind="{
|
||||||
|
id: props.node.id,
|
||||||
data: props.node.data,
|
data: props.node.data,
|
||||||
type: props.node.type,
|
type: props.node.type,
|
||||||
xPos: props.node.__rf.position.x,
|
xPos: props.node.__rf.position.x,
|
||||||
@@ -193,6 +194,7 @@ watch(
|
|||||||
<component
|
<component
|
||||||
:is="props.type"
|
:is="props.type"
|
||||||
v-bind="{
|
v-bind="{
|
||||||
|
id: props.node.id,
|
||||||
data: props.node.data,
|
data: props.node.data,
|
||||||
type: props.node.type,
|
type: props.node.type,
|
||||||
xPos: props.node.__rf.position.x,
|
xPos: props.node.__rf.position.x,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Handle from '~/components/Handle/Handle.vue'
|
import Handle from '~/components/Handle/Handle.vue'
|
||||||
import { NodeProps, Position } from '~/types'
|
import { NodeProps, Position } from '~/types'
|
||||||
|
|
||||||
interface OutputNodeProps {
|
interface OutputNodeProps extends NodeProps {
|
||||||
data?: NodeProps['data']
|
data?: NodeProps['data']
|
||||||
connectable?: NodeProps['connectable']
|
connectable?: NodeProps['connectable']
|
||||||
targetPosition?: NodeProps['targetPosition']
|
targetPosition?: NodeProps['targetPosition']
|
||||||
|
|||||||
Reference in New Issue
Block a user