From 7d47904a810dcdf8cf3faf582e4799b00594d048 Mon Sep 17 00:00:00 2001 From: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 22 Jun 2022 21:15:25 +0200 Subject: [PATCH] docs: documentation for new node `events` property --- docs/src/guide/node.md | 104 ++++++++++++++++++++++++++++++++--------- 1 file changed, 83 insertions(+), 21 deletions(-) diff --git a/docs/src/guide/node.md b/docs/src/guide/node.md index 1a49f915..afe15b11 100644 --- a/docs/src/guide/node.md +++ b/docs/src/guide/node.md @@ -91,7 +91,7 @@ onMounted(() => { You can also apply changes using the [`applyNodeChanges`](/typedocs/interfaces/Actions.html#applynodechanges/) utility function, which expects an array of [changes](/typedocs/types/NodeChange.html/) to be applied to the currently stored nodes. -```vue:no-line-numbers +```vue:no-line-numbers{11,17-22} +``` + +As you can see above, you can also pass in custom event handlers. These will not be called by Vue Flow but can be used +to forward callback functions to your custom components. +The `click` handler is part of the [`NodeEvents`](/typedocs/interfaces/NodeEvents.html) interface, meaning it will be +triggered when the node is clicked. + +```vue:no-line-numbers + + +``` ## Styling @@ -351,5 +413,5 @@ When you create a new node type you also need to implement some styling. Your cu You can use the `noWheelClassName` prop to define a class which will prevent zoom-on-scroll or pan-on-scroll behavior on that element. -By default the `noWheelClassName` is `.nowheel`. +By default, the `noWheelClassName` is `.nowheel`. By adding this class you can also enable scrolling inside a node.