feat: update graph on new elements pushed

This commit is contained in:
Braks
2021-07-09 16:32:03 +02:00
parent ea98c2afa1
commit 125340341d
5 changed files with 35 additions and 46 deletions
+1 -4
View File
@@ -21,10 +21,7 @@ const BasicFlow = defineComponent({
const rfInstance = ref<OnLoadParams | null>(null);
const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value));
const onConnect = (params: Edge | Connection) => (elements.value = addEdge(params, elements.value));
const onLoad = (reactFlowInstance: OnLoadParams) => {
console.log('loaded', reactFlowInstance);
rfInstance.value = reactFlowInstance;
};
const onLoad = (reactFlowInstance: OnLoadParams) => (rfInstance.value = reactFlowInstance);
const updatePos = () => {
elements.value = elements.value.map((el) => {