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>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<Teleport :disabled="!node.teleport" :to="node.teleport">
|
||||||
<div
|
<div
|
||||||
ref="nodeElement"
|
ref="nodeElement"
|
||||||
:class="getClass"
|
:class="getClass"
|
||||||
@@ -280,4 +281,5 @@ export default {
|
|||||||
:node-element="nodeElement"
|
:node-element="nodeElement"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</Teleport>
|
||||||
</template>
|
</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 { BaseElement, Dimensions, ElementData, Position, SnapGrid, XYPosition, XYZPosition } from './flow'
|
||||||
import type { DefaultNodeTypes, NodeComponent } from './components'
|
import type { DefaultNodeTypes, NodeComponent } from './components'
|
||||||
import type { HandleElement, ValidConnectionFunc } from './handle'
|
import type { HandleElement, ValidConnectionFunc } from './handle'
|
||||||
@@ -58,6 +58,9 @@ export interface Node<Data = ElementData> extends BaseElement<Data> {
|
|||||||
|
|
||||||
/** overwrites current node type */
|
/** overwrites current node type */
|
||||||
template?: NodeComponent
|
template?: NodeComponent
|
||||||
|
|
||||||
|
/** teleports node element to specified dom location */
|
||||||
|
teleport?: TeleportProps['to']
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GraphNode<Data = ElementData> extends Node<Data> {
|
export interface GraphNode<Data = ElementData> extends Node<Data> {
|
||||||
|
|||||||
Reference in New Issue
Block a user