Skip to content

Custom Node Documentation incorrect? #1772

Answered by bcakmakoglu
PhilG0lding asked this question in Q&A
Discussion options

You must be logged in to vote

Firstly, it looks like './nodes' file is missing, referenced in CustomNode.vue:

True, I'll inline the types so it's clear what they represent.

As to the rest of your issues:

  1. Avoid using "CustomEvents" - it's going to be removed really soon and it serves no meaningful purpose. If you need to add some "listener" to a node, put it into node.data.
  2. A Node type could look like this:
interface ColorSelectorData {
  color: string
}

type ColorSelectorNode = Node<ColorSelectorData, {}, 'color-selector'>
  1. If, for whatever reason, you have to use CustomEvents you can try this:
import type { Node } from '@vue-flow/core'

interface ColorSelectorData {
  color: string
}

interface CustomEvents ext…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PhilG0lding
Comment options

Answer selected by PhilG0lding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants