fix!: props and composable not merging together properly

* Add getter for node/edge types
* change nodeTypes prop type to only Record<string, NodeType> - same for edges
* Add rgb example
* remove v-model for elements

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-19 01:43:07 +01:00
parent c8d3ff6a29
commit 70b077a1f5
12 changed files with 286 additions and 157 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import {
Edge,
Elements,
ConnectionMode,
useStore,
useVueFlow,
} from '~/index'
import './provider.css'
@@ -28,7 +28,7 @@ const initialElements: Elements = [
{ id: 'e1-3', source: '1', target: '3' },
]
useStore()
useVueFlow()
const elements = ref<Elements>(initialElements)
const onConnect = (params: Connection | Edge) => (elements.value = addEdge(params, elements.value))
const onElementsRemove = (elementsToRemove: Elements) => (elements.value = removeElements(elementsToRemove, elements.value))