feat(nodes): Add teleport option to nodes
# What's changed? * Add option to set a teleport target to nodes
This commit is contained in:
@@ -246,6 +246,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport :disabled="!node.teleport" :to="node.teleport">
|
||||
<div
|
||||
ref="nodeElement"
|
||||
:class="getClass"
|
||||
@@ -280,4 +281,5 @@ export default {
|
||||
:node-element="nodeElement"
|
||||
/>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Component, VNode } from 'vue'
|
||||
import type { Component, TeleportProps, VNode } from 'vue'
|
||||
import type { BaseElement, Dimensions, ElementData, Position, SnapGrid, XYPosition, XYZPosition } from './flow'
|
||||
import type { DefaultNodeTypes, NodeComponent } from './components'
|
||||
import type { HandleElement, ValidConnectionFunc } from './handle'
|
||||
@@ -58,6 +58,9 @@ export interface Node<Data = ElementData> extends BaseElement<Data> {
|
||||
|
||||
/** overwrites current node type */
|
||||
template?: NodeComponent
|
||||
|
||||
/** teleports node element to specified dom location */
|
||||
teleport?: TeleportProps['to']
|
||||
}
|
||||
|
||||
export interface GraphNode<Data = ElementData> extends Node<Data> {
|
||||
|
||||
Reference in New Issue
Block a user