docs: update examples

This commit is contained in:
braks
2022-11-13 19:13:43 +01:00
committed by Braks
parent f6a97c504b
commit cd03034bdb
35 changed files with 222 additions and 161 deletions
@@ -12,7 +12,7 @@ export const useTeleport = (id) => {
const transition = ref(false)
const teleport = ref(null)
const { updateNodeInternals, getNode, edges } = useVueFlow()
const { updateNodeInternals, findNode, edges } = useVueFlow()
/**
* specify a selector to teleport to
@@ -65,7 +65,7 @@ export const useTeleport = (id) => {
* i.e. if they emit events, they will still emit them up their regular tree
*/
const onClick = (destination) => {
const node = getNode.value(id)
const node = findNode(id)
transition.value = true
@@ -79,13 +79,13 @@ export const useTeleport = (id) => {
// check if nodes connected to edge are teleported and hide edge if one of them is
if (destination) {
connectedEdges.forEach(
(edge) => (edge.hidden = !!getNode.value(edge.source).data.destination || !!getNode.value(edge.target).data.destination),
(edge) => (edge.hidden = !!findNode(edge.source).data.destination || !!findNode(edge.target).data.destination),
)
}
const onFinish = () => {
connectedEdges.forEach(
(edge) => (edge.hidden = !!getNode.value(edge.source).data.destination || !!getNode.value(edge.target).data.destination),
(edge) => (edge.hidden = !!findNode(edge.source).data.destination || !!findNode(edge.target).data.destination),
)
}