fix examples
This commit is contained in:
@@ -145,7 +145,7 @@
|
|||||||
let { updateNode } = $derived(useSvelteFlow());
|
let { updateNode } = $derived(useSvelteFlow());
|
||||||
|
|
||||||
function hideUnhide() {
|
function hideUnhide() {
|
||||||
updateNode('hideunhide', (node) => ({ hidden: !node.hidden }));
|
updateNode('hideunhide', (node) => ({ ...node, hidden: !node.hidden }));
|
||||||
}
|
}
|
||||||
|
|
||||||
// $inspect(edges);
|
// $inspect(edges);
|
||||||
|
|||||||
@@ -55,7 +55,10 @@
|
|||||||
const { updateNode } = $derived(useSvelteFlow());
|
const { updateNode } = $derived(useSvelteFlow());
|
||||||
|
|
||||||
const updateNodePosition = () => {
|
const updateNodePosition = () => {
|
||||||
updateNode('1', (node) => ({ position: { x: node.position.x + 10, y: node.position.y } }));
|
updateNode('1', (node) => ({
|
||||||
|
...node,
|
||||||
|
position: { x: node.position.x + 10, y: node.position.y }
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user