useNodeId()
The useNodeId composable returns the id of the node a component is rendered in. It reads
the node context that Vue Flow provides around every custom node, so it only returns
a value when called inside a custom node (or one
of its descendants) — otherwise it returns null.
<!-- inside a custom node or a child of one -->
<script setup lang="ts">
import { useNodeId } from '@xyflow/vue';
const nodeId = useNodeId();
</script>Signature
Parameters:This function does not accept any parameters.
Returns: