feat: Make edges work

This commit is contained in:
Braks
2021-07-09 13:39:17 +02:00
parent 52e1188d04
commit b2c250ef38
10 changed files with 183 additions and 99 deletions
+15 -5
View File
@@ -6,7 +6,18 @@ import { onLoadProject, onLoadGetElements, onLoadToObject } from '../../utils/gr
import { ReactFlowProps } from '../RevueFlow';
import { NodeTypesType, EdgeTypesType, ConnectionLineType, KeyCode } from '../../types';
import { CSSProperties, defineComponent, onMounted, PropType, ref } from 'vue';
import {
reactive,
computed,
CSSProperties,
defineComponent,
onBeforeMount,
onMounted,
onUpdated,
PropType,
ref,
watch
} from 'vue';
import store from '../../store';
import useZoomPanHelper from '../../hooks/useZoomPanHelper';
@@ -350,9 +361,9 @@ const GraphView = defineComponent({
const pinia = store();
const isInitialized = ref<boolean>(false);
const { zoomIn, zoomOut, zoomTo, transform, fitView, initialized } = useZoomPanHelper();
onMounted(() => {
const { zoomIn, zoomOut, zoomTo, transform, fitView, initialized } = useZoomPanHelper();
if (!isInitialized.value && initialized) {
if (props.onLoad) {
props.onLoad({
@@ -364,9 +375,8 @@ const GraphView = defineComponent({
project: onLoadProject(pinia),
getElements: onLoadGetElements(pinia),
toObject: onLoadToObject(pinia)
} as any);
});
}
isInitialized.value = true;
}
});