fix: inject store instance components
chore: update revue-draggable to next tag
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
import { computed, CSSProperties, defineComponent, HTMLAttributes, onBeforeUnmount, PropType, provide, watchEffect } from 'vue';
|
||||
import {
|
||||
computed,
|
||||
CSSProperties,
|
||||
defineComponent,
|
||||
HTMLAttributes,
|
||||
onBeforeUnmount,
|
||||
onUpdated,
|
||||
PropType,
|
||||
provide,
|
||||
watchEffect
|
||||
} from 'vue';
|
||||
import GraphView from '../GraphView';
|
||||
import DefaultNode from '../../components/Nodes/DefaultNode';
|
||||
import InputNode from '../../components/Nodes/InputNode';
|
||||
@@ -547,6 +557,11 @@ const RevueFlow = defineComponent({
|
||||
props.onSelectionChange?.(store.selectedElements);
|
||||
});
|
||||
|
||||
onUpdated(() => {
|
||||
store.setElements(props.elements);
|
||||
props.onSelectionChange?.(store.selectedElements);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
store.$reset();
|
||||
store.setElements([]);
|
||||
|
||||
Reference in New Issue
Block a user