update: Flow instance provides update node internals func
* Rename onLoadParams to FlowInstance * Pass update node internals to instance
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import localforage from 'localforage'
|
||||
import { useZoomPanHelper, OnLoadParams, FlowExportObject, Node } from '~/index'
|
||||
import { useZoomPanHelper, FlowInstance, FlowExportObject, Node } from '~/index'
|
||||
|
||||
localforage.config({
|
||||
name: 'vue-flow',
|
||||
@@ -14,7 +14,7 @@ const getNodeId = () => `randomnode_${+new Date()}`
|
||||
const { transform } = useZoomPanHelper()
|
||||
|
||||
type ControlsProps = {
|
||||
flowInstance?: OnLoadParams
|
||||
flowInstance?: FlowInstance
|
||||
}
|
||||
|
||||
const props = defineProps<ControlsProps>()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import Controls from './Controls.vue'
|
||||
import Flow, { addEdge, Connection, Node, Edge, Elements, OnLoadParams, removeElements } from '~/index'
|
||||
import Flow, { addEdge, Connection, Node, Edge, Elements, FlowInstance, removeElements } from '~/index'
|
||||
|
||||
import './save.css'
|
||||
|
||||
@@ -15,7 +15,7 @@ const flowInstance = ref()
|
||||
|
||||
const onConnect = (params: Connection | Edge) => (elements.value = addEdge(params, elements.value))
|
||||
const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value))
|
||||
const onLoad = (instance: OnLoadParams) => (flowInstance.value = instance)
|
||||
const onLoad = (instance: FlowInstance) => (flowInstance.value = instance)
|
||||
const onRestore = (els: Elements) => (elements.value = els)
|
||||
const onAdd = (el: Node) => (elements.value = elements.value.concat(el))
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user