Questions and perhaps improvements on Nested Nodes #416
-
function removeNode(node) {
removeNodes([node.id]);
} <q-card-actions align="right">
<q-btn flat round color="red" icon="close" @click="removeNode(props.data)" />
<q-btn flat round color="secondary" icon="content_copy" />
</q-card-actions> We are very impressed with the lib and the decision is nearly decided to go with the lib, it's very customizable, it works great with Quasar it's very customizable 😉 Question 1Question 2 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
As for alternative solutions: Maybe you can give me a rough idea on how your custom node is supposed to look, then I could give you some tips on how to achieve it and if there are any particular challenges in doing so.
The edges might also change in the future (which is actually more likely than point 1, improvements to edges are always on the list of things to do 😄).
If you're using template slots, all you gotta do is this <template #node-custom="props">
<CustomNode v-bind="props" />
</template> This will pass the whole You also need to define props in your custom node of course to receive these props. For example like this: const props = defineProps({
id: {
type: String,
required: true,
},
})
console.log(props.id) or if you're using TypeScript import type { NodeProps } from '@vue-flow/core'
interface Props extends NodeProps {
id: string
}
const props = defineProps<Props>()
console.log(props.id) I believe you misunderstood the custom node example. To make it more obvious, let's look at the template slots again. <-- let's destructure the `NodeProps` object to make it clearer what props are available -->
<template #node-custom="{ id, data, position, dimensions, connectable, type, zIndex, sourcePosition, targetPosition }">
<!-- let's pass id and data to our custom node, we don't need the rest of the props -->
<CustomNode :id="id" :data="data" />
</template> If you got any more questions or concerns, let me know and I'll be happy to help. :) |
Beta Was this translation helpful? Give feedback.
As for alternative solutions:
You could just not use the nested nodes feature and simply align your elements without it. The main benefit of the nested nodes feature is that you can use the parent to move all it's children as well.
If you don't necessarily need that behavior, simply don't use it 😄
I'm not sure how your Quasar collapsible s…